列表格式显示
广告招商中...... 联系方式!
私信 +好友
目录
一、debug_print_backtrace()
二、debug_backtrace()
三、Exception类中的getTraceAsString()成员函数返回一个调用堆栈
//调用函数parent_func
function child_func() {
parent_func();
}
//调用grandparent_func
function parent_func() {
grandparent_func();
//打印调用堆栈
function grandparent_func() {
debug_print_backtrace();
//主函数调用
child_func();
#0 grandparent_func() called at [D:\wamp\www\temp.php:10]
#1 parent_func() called at [D:\wamp\www\temp.php:5]
#2 child_func() called at [D:\wamp\www\temp.php:19]
var_dump(debug_backtrace());
D:\wamp\www\temp.php:15:
array (size=3)
0 =>
array (size=4)
'file' => string 'D:\wamp\www\temp.php' (length=27)
'line' => int 10
'function' => string 'grandparent_func' (length=16)
'args' =>
array (size=0)
empty
1 =>
'line' => int 5
'function' => string 'parent_func' (length=11)
2 =>
'line' => int 19
'function' => string 'child_func' (length=10)
三、getTraceAsString()
Exception类中的getTraceAsString()成员函数返回一个调用堆栈
$e = new Exception;
var_dump($e->getTraceAsString());
D:\wamp\www\temp.php:16:string '#0 D:\wamp\www\temp.php(10): grandparent_func()
#1 D:\wamp\www\temp.php(5): parent_func()
#2 D:\wamp\www\temp.php(20): child_func()
#3 {main}' (length=162)
相关资源:PHP堆栈调试操作简单示例资源-CSDN文库
本页Html网址:/htmlsoft/619446.html
本页aspx网址:/soft.aspx?id=619446&bianhao=202411091020288142_37703&kind1=&kind2=
最后访问时间:
上一篇:如何查看无线网卡是否支持5g wifi
下一篇:Python调用堆栈日志的方法
增加