Самый очевидный вариант - через debug_backtrace()
$trace = debug_backtrace(); $caller = $trace[1]; echo "Called by {$caller['function']}"; if (isset($caller['class'])) echo " in {$caller['class']}";
Подробнее о форматировании
ad88888ba ad888888b, ,d8 8888888888 ad88888ba d8" "88 d8" "88 ,d888 88 d8" "8b 8P 88 a8P ,d8" 88 88 ____ Y8a a8P Y8, ,d88 aad8" ,d8" 88 88a8PPPP8b, "Y8aaa8P" "PPPPPP"88 ""Y8, ,d8" 88 PP" `8b ,d8"""8b, 8P "8b 8888888888888 d8 d8" "8b 8b, a8P Y8, a88 88 Y8a a8P Y8a a8P `"Y8888P' "Y888888P' 88 "Y88888P" "Y88888P"
Имя Данил
ссылка http://twitter.com/danilshvedov
Оставить комментарий