How to get name of calling function/method in PHP?
I just wrote a version of this called "get_caller", I hope it helps. Mine is pretty lazy. You can just run get_caller() from a function, you don't have to specify it like this: get_caller(__FUNCTION__); Here's the script in full with a quirky test case: man() calls woman(), who calls get_caller().
https://stackoverflow.com/questions/2110732/how-to-get-name-of-calling-function-method-in-php
