Re: set_exception_handler catches all Throwables

From: Date: Mon, 17 Aug 2015 14:00:00 +0000
Subject: Re: set_exception_handler catches all Throwables
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-87766@lists.php.net to get a copy of this message
On Mon, 17 Aug 2015, Christian Weiske wrote: > >This is intended and documented here: > >http://php.net/manual/en/function.set-exception-handler.php > > If "Documented" means the note > > > Note that providing an explicit Exception type hint for the ex > > parameter in your callback will cause issues with the changed > > exception hierarchy in PHP 7. > > then yes, it's documented. > > But I'd not see this as documented or rather liked a more explicit > mention of Throwables there. Actually, I don't call this intended. This is just as much as a BC break as the original implementation where Errors where also Exceptions. IMO, set_exception_handler() should be changed - with my preference it not capturing Error, and instead have an additional set_throwable_handler(). cheers, Derick

« previous php.internals (#87766) next »