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).
The simplest way is:
echo debug_backtrace()[1]['function'];