How do I track down an "Exception thrown without a stack frame in Unknown on line 0" in PHP?
<p>I'm working on a large (inherited) codebase in PHP, and the error <code>Exception thrown without a stack frame in Unknown on line 0</code> has started showing up at the bottom of every page.  I understand what the error means: an exception is getting thrown someplace it can't be thrown.  I've even managed to track it down somewhat—it's happening during the time shutdown functions are being called.</p>

<p>I've put logging in all the functions which get registered with <code>register_shutdown_function</code>, and it's not happening in any of those.  Unfortunately, I can't seem to get any more information than that; I know what the last shutdown function to get called successfully is, but I have no idea what code gets executed between that and the point where the error happens.  I don't even know what part of the PHP machinery is calling that last shutdown function.  It might be something with the logging framework, or the session framework, or anything of a half-dozen things.</p>

<p>Does anyone know how to pinpoint where the error is occurring?</p>
