How to trace code execution in PHP?

蓝咒 提交于 2019-11-30 06:41:24

Xdebug is definitely what you want, but with something like callgrind from the valgrind suite as well.

Zend blog post here should give you some pointers: http://devzone.zend.com/1139/profiling-php-applications-with-xdebug/

phptrace is an awesome tool to trace php code executions

In any function you can see the whole backtrace by using debug_backtrace(...)

Or you can use Xdebug profiler to profile your PHP scripts.

UXE

Have a look at Kint.

It's var_dump() and debug_backtrace() on steroids. Easy to use, but powerful and customizable. An essential addition to your development toolbox.

it also has platform specific extensions here

You can use a PHP extension called : XHProf, developed by Facebook.

It is capable of reporting function-level call counts and inclusive and exclusive wall time, CPU time and memory usage.

https://github.com/facebook/xhprof

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!