PHP debug_print_backtrace() 函數(shù)
完整的 PHP Error 參考手冊(cè)
定義和用法
debug_print_backtrace() 函數(shù)打印 backtrace。
該函數(shù)顯示由 debug_print_backtrace() 函數(shù)代碼生成的數(shù)據(jù)。
語(yǔ)法
實(shí)例
<?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");
?>
上面代碼的輸出如下所示:
#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]
完整的 PHP Error 參考手冊(cè)