Re: [RFC] Exceptions in the engine

From: Date: Fri, 25 Oct 2013 14:03:17 +0000
Subject: Re: [RFC] Exceptions in the engine
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-69866@lists.php.net to get a copy of this message
On Fri, Oct 25, 2013 at 3:55 PM, Richard Bradley <Richard.Bradley@softwire.com> wrote: >> How could anything be reliant on the behaviour of a fatal error in any meaningful way ?? >> >> Cheers >> Joe > > In plenty of ways: for example currently frameworks can "catch" fatal errors using > "register_shutdown_function" and display an error page to the end user (say if there is an > attempt to call a method on a null object due to an unanticipated runtime error). > > Current frameworks might be broken if the way fatal errors work is changed. That would be a BC > break. > > See e.g. > http://stackoverflow.com/questions/16284235/zend-framework-error-page-for-php-fatal-errors/16284260#16284260 > > (This is not a vote for or against this proposal; I'm just answering the immediate parent > here.) Wouldn't this sort of use case be covered by the fact that an uncaught exception would still result in a fatal error? The only case it'd "break" is if you have a try/catch around your entire application, before you had to listen to have a shutdown handler but now your catch would catch the fatal exceptions before they bring everything down. I'd imagine that this RFC would not affect most sane cases of shutdown handlers and related "show a nice error page to users when all hell breaks loose" tricks. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi

« previous php.internals (#69866) next »