execute something on every function call php
Whenever any function invocation happens in PHP, I want to log the function name, its arguments and time of invocation. I开发者_如何学Gos there any means to achieve this. I have a function to log, how to set this function to execute each time any function invocation happens?
Use a profiler. Check out Xdebug. http://xdebug.org/
The best way you can do this is to call the log recording function from each of the other functions. Or else you can use a profiler as said by Adam
精彩评论