debug_print_backtrace() 函數列印backtrace。
此函數顯示由debug_print_backtrace() 函數程式碼產生的資料。
debug_print_backtrace()
<?phpfunction 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]