While tinkering for an answer to this question, I found that debug_backtrace() doesn\'t trace beyond the function registered to register_shutdown_function
This is a very expensive solution. I never used register_tick_function() or tick and I'm not sure if it works as expected.
declare(ticks=1);
function tick_handler() {
global $backtrace;
$backtrace = debug_backtrace();
}
register_tick_function('tick_handler');
function shutdown() {
global $backtrace;
// do check if $backtrace contains a fatal error...
var_dump($backtrace);
}
register_shutdown_function('shutdown');