个人随手笔记

debug_backtrace()函数生成 backtrace(回溯跟踪);

z/z/zz/a.php

PHP
1
2
3
4
5
6
class  a{
    function  __construct()
    {
       print_r(debug_backtrace());
    }
}

这样调用时

PHP
1
2
include  'z/z/zz/a.php' ;
new  a();

Plain Text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Array
(
     [0] => Array
         (
             [file] => D:\AMP\web\ide_tmp.php
             [line] => 4
             [function] => __construct
             [class] => a
             [object] => a Object
                 (
                 )
 
             [type] => ->
             [args] => Array
                 (
                 )
 
         )
 
)
能追踪哪里调用了相应的文件。



猜你喜欢

转载自blog.csdn.net/chenabin_/article/details/79537359