Hacker News new | ask | show | jobs
by wvenable 5697 days ago
That's not a problem with PHP, you just have your environment setup to return nothing on fatal error.

Shutdown functions still run after a fatal error (something I just learned), so you can display the error or redirect to another page:

    function shutdown() {
       if (($error = error_get_last())) {
         ob_clean();
         // report the event, send email etc.
         // Redirect
         header("Location: http://hostname/error");
    }
    register_shutdown_function('shutdown');
As for the empty stracktrace, I used to encounter those frequently but I don't anymore. Either Zend has been fixing them up, or I'm doing less work inside of various handlers.