简体   繁体   中英

Is it possible to figure out which functions are from an included PHP file?

I have a large file that I am looking at that has about 30 files included. I am re-factoring this file and am not entirely sure which of the function calls throughout the file are from (if any) which include file. These files have tons of functions in them.

Is there anyway to tell whether any function from an included file is used in the large file? It is hard to tell because there are many nested if-statements and rather than worrying about figuring out each one it would be easier to literally look for all of the function names in an included php file and see if any are referenced in my large file. Does something like this exist?

I think you're looking for debug_print_backtrace()

From the manual:

debug_print_backtrace() prints a PHP backtrace. It prints the function calls, included/required files and eval()ed stuff

This might actually not be a solution, there's an interesting answer to a similar question here: that might also be of help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM