Re: RFC: Replacing errors with Exceptions

From: Date: Fri, 24 Jul 2009 13:37:08 +0000
Subject: Re: RFC: Replacing errors with Exceptions
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-45071@lists.php.net to get a copy of this message
On Fri, Jul 24, 2009 at 3:23 PM, <user@domain.invalid> wrote: > I published a (work in progress) RFC today about replacing certain > errors with exceptions. I know that there already was something similiar > on the php6dev blog, but this is not completly the same, so awating your > comments: > > http://wiki.php.net/rfc/errors_as_exceptions Maybe I'm missing the point somewhere, but isn't this as simple as installing an error-handler with set_error_handler? You can install a global handler, that throws ErrorException, if you want that. The example mentioned in the rfc - simplexml_load_file - is a bit special. If you load an invalid file, you may get more than one error. If these were converted into exceptions, you would miss all but the first. > user@domain.invalid whois -- troels

« previous php.internals (#45071) next »