tags:

views:

56

answers:

1

I am aware of function debug_backtrace, but I am looking for some ready to use implementation of function like GetCallingMethodName()? It would be perfect if it gave method's class too (if it is indeed a method).

I hope it (not doing it myself) want be taken as normal laziness, but as good programming laziness.

EDIT: Here is the answer: http://stackoverflow.com/questions/190421/caller-function-in-php-5/190426#190426

+4  A: 

The debug_backtrace() function is the only way to know this, if you're lazy it's one more reason you should code the GetCallingMethodName() yourself. Fight the laziness! :D

Alix Axel
"Fight the laziness! :D" But laziness is a good thing:http://www.codinghorror.com/blog/archives/000237.html:}So if someone has written such a function, I would really appreciate... :}
JohnM2
@Davvid: Have you Googled **PHP GetCallingFunction** and **PHP GetCallingMethod**? Or are you too lazy for that too? :P
Alix Axel
Who needs google while having such a great 'programming answers search engine' as stackoverflow users like You :}http://stackoverflow.com/questions/190421/caller-function-in-php-5/190426#190426Now seriously, thanks!
JohnM2