开发者

execute something on every function call php

开发者 https://www.devze.com 2023-04-12 04:59 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号