I'm creating an automatic mechanism to turn all methods of classes to "private". Then I will add a __call method, to track down the callings. The only problem is how to do this without spoiling other strings, comments etc.
- 5Why would you want to do that?nice ass– nice ass2014-02-05 16:02:55 +00:00Commented Feb 5, 2014 at 16:02
- 1Google "PHP refactoring".user188654– user1886542014-02-05 16:03:52 +00:00Commented Feb 5, 2014 at 16:03
- I want to track down all method callings, examine their running time, memory etcJohn Smith– John Smith2014-02-05 16:05:52 +00:00Commented Feb 5, 2014 at 16:05
- 5What's wrong with using the xdebug extension for such things?nice ass– nice ass2014-02-05 16:07:50 +00:00Commented Feb 5, 2014 at 16:07
- 2@JohnSmith It is an extension that you install and then enable. See the installation instructions.Sverri M. Olsen– Sverri M. Olsen2014-02-05 16:20:52 +00:00Commented Feb 5, 2014 at 16:20
| Show 2 more comments
1 Answer
I want to track down all method callings, examine their running time, memory etc
There are already tools for that, search for php profiling, I could recommend xhprof.
If for some reason you don't want to use these, try Reflection