时间:2021-07-01 10:21:17 帮助过:15人阅读
class a{
function say($msg) {
echo "msg:".$msg;
echo "";debug_print_backtrace();输出结果
}
}
class b {
function say($msg) {
$a = new a();
$a->say($msg);
}
}
class c {
function __construct($msg) {
$b = new b();
$b->say($msg);
}
}
$c = new c("test");
代码如下:
msg:test
#0 a->say(test) called at [/var/www/test/test0723.php:12]
#1 b->say(test) called at [/var/www/test/test0723.php:19]
#2 c->__construct(test) called at [/var/www/test/test0723.php:23]
相关链接
http://ch2.php.com/manual/zh/function.debug-print-backtrace.php
http://ch2.php.com/manual/zh/function.debug-backtrace.php