在PHP中,如何将所有方法转换为“私有”?

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.

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