This way we can get a memory dump when the memory_limit is exceeded, and as the dump contains the call frame of this shutdown handler, we can get the last line and file executed from the content of $error. But the backtrace from the point where the error happens can't be retrieved at this point...
Maybe I should write an extension only capturing the backtrace on memory_limit violations?
#php