Re:New to PHP 5.4: Traits
by wvenable on Saturday November 20, 2010 @05:05PM
(#1925462)
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.
Shutdown functions still run after a fatal error (something I just learned), so you can display the error or redirect to another page:
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.