php中堆栈调试
2015-07-27 22:57
816 查看
你是否想知道当前函数被哪些文件调用了,如果知道了这些路径,我们就能很好的理解程序的执行过程,这是非常重要的,也是了解别人程序的基础,那么这里我就给大家介绍一种php中的堆栈调试的方法,其实就是php内置的一个函数
下面是就稍微介绍一下吧,具体还是要看手册哦,喜欢看手册的程序员才是前途无量的
这里是打印出来的数组,非常的好了
debug_backtrace();
下面是就稍微介绍一下吧,具体还是要看手册哦,喜欢看手册的程序员才是前途无量的
[code]$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 ) )
这里是打印出来的数组,非常的好了
相关文章推荐
- thinkphp无限递归查询分类
- php文件操作系列
- YII框架修改页面布局
- php获取文件名称和扩展名
- 汇率转换
- php编程冒泡排序
- TP中cache方法使用
- input a random number from 1-100. Output a random number from 1-30
- php吧字符串直接转换成数组处理
- 监听ContentProvider中数据的变化
- URI+ContentProvider+ContenResolver
- PHP上传文件(学习)
- sycPHPCMS v1.6 cookie sqlinjection
- 360浏览器 极速模式下,有些幻灯图片不显示,但其它火狐和IE浏览器都显示
- php技术实现加载字体并保存成图片
- PHP中的SESSION机制
- 关于onethinkphp 分类数据
- PHP之cookie详解
- PHP 连接新浪云,mySQL数据库时,出错的问题解决
- phpMyadmin 修改上传文件大小限制