Home >Backend Development >PHP Tutorial >Is there any function in php that can track the order of code loading, similar to the page_trace function in tp, [except debug_backtrace]
Is there any function in php that can track the files loaded and the order in which the current script is executed? The function is similar to page_trace in thinkphp
Is there any function in php that can track the files loaded and the order in which the current script is executed? The function is similar to page_trace in thinkphp
<code class="php">$e = new \Exception; var_dump($e->getTraceAsString());</code>
<code class="php">function A() { echo 1; $e = new \Exception; var_dump($e->getTraceAsString()); } function B() { A(); } function C() { B(); } C();</code>
It is very convenient to view the call stack, more readable than debug_backtrace