Re: RFC: Replacing errors with Exceptions

From: Date: Fri, 24 Jul 2009 14:29:40 +0000
Subject: Re: RFC: Replacing errors with Exceptions
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-45077@lists.php.net to get a copy of this message
On Fri, Jul 24, 2009 at 15:43, Ben Scholzen 'DASPRiD'<mail@dasprids.de> wrote: > To you both, this is especially, for library code like Zend Framework. > The library cannot expect the user to have the error handle set, so it > would have to replace the error handler before every line which it wants > to try {} and reset it after the catch. This is not really a clean > solution, at it can occur pretty often. Why do you have to replace it? You RFC says you want to throw exceptions for all E_WARNINGs - thats exactly the same as *not* restoring it. Just register errorhandler for E_WARNING and thats it. The libxml extension already has functionality to suppress XML errors, so your simplexml_load_file() example is bogus. Better example is fopen() on network failures, but even then I don't understand the problem. -Hannes

« previous php.internals (#45077) next »