Today I ran into a problem where my PHP Application would throw this fatal error:
Fatal error: Exception thrown without a stack frame in Unknown on line 0
… After a few minutes I found the problem: I had a class that would save itself to the Session, and that class also had a __sleep method which is invoked on serialization.
PHP, Sessions, __sleep, and Exceptions | Justin Carmony
I had a similar problem not too long ago. My solution was to call:
register_shutdown_function('session_write_close');
at the beginning of the bootstrap process.
Source: justincarmony.com
