While tinkering for an answer to this question, I found that debug_backtrace() doesn\'t trace beyond the function registered to register_shutdown_function(), when called from within it.
I am using print_r(debug_backtrace(), true) to retrieve a string representation of the debug backtrace.This works fine, as print_r handles recursion.
Is there any way to get the caller function with something else than debug_backtrace()? I\'m looking for a less greedy way to simulate scopes like friend or internal.