Kartins
Kartins

Reputation: 3569

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. Is 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?

Upvotes: 6

Views: 478

Answers (2)

user712517
user712517

Reputation:

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

Upvotes: 0

Adam Trachtenberg
Adam Trachtenberg

Reputation: 2241

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

Upvotes: 2

Related Questions