PHP - 如何查看类执行的所有操作?

时间:2011-11-23 09:13:18

标签: php debugging trace

  

可能重复:
  PHP - I want to know how to get function trace

当我调用它时,我需要看看php脚本的作用。

我正在调用类似的脚本:

php -f thescript.php --option1 --option2

代码是这样的:

class thescript {

    static function func01($some_parameter) {
        //some code here
    }

    static function func02($some_parameter) {
        //some code here
    }

    static function func03($some_parameter) {
        //some code here
    }

}

function helperFunction01($some_parameter)
{
    //some code here
}

如何跟踪呼叫所经历的所有功能和方法?

最诚挚的问候,

2 个答案:

答案 0 :(得分:2)

我认为您可以使用xdebug执行此操作http://xdebug.org/docs/execution_trace

答案 1 :(得分:0)

您可以执行debug_backtrace()来查看您最终到达哪个电话。