Last active
September 22, 2016 16:56
-
-
Save ethaizone/06c6a6f55569f5cc8878e625f966e26c to your computer and use it in GitHub Desktop.
Get called function in PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is function for function | |
// Usage like http://php.net/manual/en/function.get-called-class.php | |
function get_called_func() | |
{ | |
$trace = array_slice(debug_backtrace(), -2, 1); | |
return $trace['function']; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment