Re: [PHP.next] Error-handling using "Error Events"

From: Date: Sat, 12 Apr 2014 01:05:16 +0000
Subject: Re: [PHP.next] Error-handling using "Error Events"
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-73674@lists.php.net to get a copy of this message
On Fri, Apr 11, 2014 at 7:52 PM, Stas Malyshev <smalyshev@sugarcrm.com> wrote: > Hi! > >> behavior using try/catch blocks as Stas mentioned. However, people who >> actually want this sort of behavior so they can route everything through >> their own custom handlers (might be particularly useful for framework >> developers) could switch it on. Something like ini_set( > > Why just not set error handler which would throw an exception? You manually have to reconstruct the stack trace from the exception handler; also, with this approach you lose the ability to fine-control where you want to react on which exceptions in which way - unless you do a save/restore every time... Also, you need to parse the error string by PHP (e.g. in one code block you do a fopen followed by a mysqli_connect, both might throw you a E_WARNING) in order to find out what's going on. Marco

« previous php.internals (#73674) next »