如何在PHP中找到导致print_r显示的源文件


How can I find the source file that causes the print_r display in PHP

我想知道如何调试以找到导致print_r的源文件(可能还有代码中的行号)?或者有没有一个包可以在页面加载期间用于这种调试?类似的想法,比如开发工具中的console.log。

PHP中的debug_print_backtrace()可能会对您有所帮助。通过这种方式,您可以查看已调用的所有函数。

更多详细信息:http://php.net/manual/en/function.debug-print-backtrace.php