Any function in php can trace the order of code loading, similar to page_trace in tp, except debug_backtrace]

Source: Internet
Author: User
What functions in php can trace the files loaded and the order of loading when the current script is executed. the function is similar to what functions in page_trace php in thinkphp can trace the execution of the current script, the loaded files and the loading sequence are similar to page_trace in thinkphp.

Reply content:

In php, what functions can be used to track the files loaded and the order of loading when the current script is executed? the function is similar to page_trace in thinkphp.

$ E = new \ Exception; var_dump ($ e-> getTraceAsString ());
Function A () {echo 1; $ e = new \ Exception; var_dump ($ e-> getTraceAsString ();} function B () {();} function C () {B ();} C ();

It is very convenient to view the call stack and is more readable than debug_backtrace.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.