PHP debug_print_backtrace() 函数
![PHP Error 参考手册](http://static.json.cn/r/uploadfile/up/3e/a9/18/41e5761fb9ace3ecbd611c59b218a93e.jpg)
定义和用法
debug_print_backtrace() 函数打印 backtrace。
该函数显示由 debug_print_backtrace() 函数代码生成的数据。
语法
debug_print_backtrace()
实例
<?php
function one($str1, $str2)
{
two("Glenn", "Quagmire");
}
function two($str1, $str2)
{
three("Cleveland", "Brown");
}
function three($str1, $str2)
{
debug_print_backtrace();
}
one("Peter", "Griffin");
?>
function one($str1, $str2)
{
two("Glenn", "Quagmire");
}
function two($str1, $str2)
{
three("Cleveland", "Brown");
}
function three($str1, $str2)
{
debug_print_backtrace();
}
one("Peter", "Griffin");
?>
上面代码的输出如下所示:
#0 three(Cleveland, Brown) called at [C:webfoldertest.php:8]
#1 two(Glenn, Quagmire) called at [C:webfoldertest.php:4]
#2 one(Peter, Griffin) called at [C:webfoldertest.php:15]
#1 two(Glenn, Quagmire) called at [C:webfoldertest.php:4]
#2 one(Peter, Griffin) called at [C:webfoldertest.php:15]
![PHP Error 参考手册](http://static.json.cn/r/uploadfile/up/3e/a9/18/41e5761fb9ace3ecbd611c59b218a93e.jpg)