Problem
You want to determine the name of the currently running function. This is useful for creating error messages that don't need to be changed if you copy and paste the subroutine code.
Solution
Use the caller function:
$this_function = (caller(0))[3];
Discussion
(
Read more... )