时间:2021-07-01 10:21:17 帮助过:22人阅读
debug_backtrace();
下面是就稍微介绍一下吧,具体还是要看手册哦,喜欢看手册的程序员才是前途无量的
$statcks = debug_backtrace();
$tmp_arr = array();
if(!$stacks) return $tmp_arr;
foreach($stacks as $k=>$v)
{
$tmp[$k]['file'] = isset($v['file']) ? $v['file'] : '--';
$tmp[$k]['line'] = isset($v['line'])? $v['line'] : '--';
$tmp[$k]['function'] = isset($v['function']) ? $v['function'] : '--';
}
Array
(
[0] => Array
(
[file] =>D:\wwwroot\CodeIgniter\application\controllers\finance\channel.php
[line] =>128
[function] => get_total_rows
)
[1] => Array
(
[file] => --
[line] => --
[function] => index
)
[2] => Array
(
[file] =>D:\wwwroot\CodeIgniter\application\controllers\finance\channel.php
[line] =>46
[function] => call_user_func
)
[3] => Array
(
[file] => --
[line] => --
[function] => get_nav
)
[4] => Array
(
[file] =>D:\wwwroot\CodeIgniter\system\core\CodeIgniter.php
[line] =>360
[function] => call_user_func_array
)
[5] => Array
(
[file] =>D:\wwwroot\CodeIgniter\index.php
[line] =>205
[function] => require_once
)
)
这里是打印出来的数组,非常的好了
版权声明:本文为博主原创文章,未经博主允许不得转载。
以上就介绍了php中堆栈调试,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。