RE: [PHP-DEV] [RFC] Exceptions in the engine
| From: | Richard Bradley | Date: | Fri, 25 Oct 2013 13:55:50 +0000 |
| Subject: | RE: [PHP-DEV] [RFC] Exceptions in the engine | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-69865@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Joe Watkins [mailto:krakjoe@php.net]
> Sent: 25 October 2013 14:02
> To: internals@lists.php.net; Larry Garfield
> Subject: Re: [PHP-DEV] [RFC] Exceptions in the engine
>
> On 10/24/2013 11:31 PM, Larry Garfield wrote:
> > On 10/24/13 12:41 PM, Nikita Popov wrote:
> >> Hi internals!
> >>
> >> I'd like to propose an RFC, which allows the use of exceptions within
> >> the engine and also allows changing existing fatal errors to exceptions:
> >>
> >> https://wiki.php.net/rfc/engine_exceptions
> >>
> >> This topic has been cropping up in the discussions for several of the
> >> recent RFCs and I think the time has come to consider moving away
> >> from fatal errors.
> >>
> >> Thoughts?
> >>
> >> Thanks,
> >> Nikita
> >
> > As a PHP user-space developer I love this idea. However, I share the
> > concern of others here that it could result in BC unpleasantness, even
> > if limited to the E_FATAL and E_RECOVERABLE_FATAL use cases. I don't
> > know off hand how various versions of Drupal would handle this.
> >
> > --Larry Garfield
>
> 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.)
Best,
Rich
Richard Bradley
Tel : 020 7485 7500 ext 3230 | Fax : 020 7485 7575
softwire
Sunday Times Best Small Companies - UK top 20 three years running
Web : www.softwire.com | Addr : 325 Highgate Studios, 53-79 Highgate Road, London NW5 1TL
Softwire Technology Limited. Registered in England no. 3824658. Registered Office : 13 Station Road,
London N3 2SB