Run something with every php function call

Whenever any function call occurs in PHP, I want to write down the name of the function, its arguments, and the time of the call. Are there any means to achieve this. I have a function to register, how to set this function to execute on every function call?

+6
source share
2 answers

Use a profiler. Check out Xdebug. http://xdebug.org/

+2
source

The best way to do this is to call the logging function from each of the other functions. Or you can use the profiler as Adam said

0
source

Source: https://habr.com/ru/post/899104/


All Articles