Re: [PHP-DEV] set_exception_handler catches all Throwables

2015-08-19 Thread Björn Larsson
Den 2015-08-19 kl. 15:55, skrev Ryan Pallas: On Aug 19, 2015 6:44 AM, Björn Larsson bjorn.x.lars...@telia.com mailto:bjorn.x.lars...@telia.com wrote: Plan to migrate to PHP 7 later, like the new Exception/Error way of working very much. Point is that current set_exception_handler only

Re: [PHP-DEV] set_exception_handler catches all Throwables

2015-08-19 Thread Björn Larsson
Plan to migrate to PHP 7 later, like the new Exception/Error way of working very much. Point is that current set_exception_handler only address exceptions, not errors. You are right that on that the surface it's the same callback, but could eg be logging in different ways and to different

Re: [PHP-DEV] set_exception_handler catches all Throwables

2015-08-19 Thread Niklas Keller
What do you guys do in the set_exception_handler callback? Wouldn't most code just use the same callback and just log the error / exception? Regards, Niklas 2015-08-19 11:55 GMT+02:00 Björn Larsson bjorn.x.lars...@telia.com: Den 2015-08-19 kl. 10:52, skrev Peter Cowburn: On 17 August 2015 at

Re: [PHP-DEV] set_exception_handler catches all Throwables

2015-08-19 Thread Björn Larsson
Den 2015-08-19 kl. 10:52, skrev Peter Cowburn: On 17 August 2015 at 15:24, Sebastian Bergmann sebast...@php.net wrote: Am 17.08.2015 um 16:00 schrieb Derick Rethans: Actually, I don't call this intended. This is just as much as a BC break as the original implementation where Errors where also

Re: [PHP-DEV] set_exception_handler catches all Throwables

2015-08-19 Thread Niklas Keller
I agree with this completely. I think the point here is that catch(Exception $e) remains unchanged while setting a handler actually catches more things now. Tbh I feel like this is an oversight in implementing the Error/Throwable rfc and should be addressed now, otherwise it can't be changed

Re: [PHP-DEV] set_exception_handler catches all Throwables

2015-08-19 Thread Ryan Pallas
On Aug 19, 2015 6:44 AM, Björn Larsson bjorn.x.lars...@telia.com wrote: Plan to migrate to PHP 7 later, like the new Exception/Error way of working very much. Point is that current set_exception_handler only address exceptions, not errors. You are right that on that the surface it's the same

Re: [PHP-DEV] set_exception_handler catches all Throwables

2015-08-19 Thread Adam Harvey
On 19 August 2015 at 07:20, Björn Larsson bjorn.x.lars...@telia.com wrote: Den 2015-08-19 kl. 15:55, skrev Ryan Pallas: I agree with this completely. I think the point here is that catch(Exception $e) remains unchanged while setting a handler actually catches more things now. Tbh I feel like

Re: [PHP-DEV] set_exception_handler catches all Throwables

2015-08-19 Thread Stanislav Malyshev
Hi! We're trying to use TYPO3 on PHP7 and have the problem that throwables get passed to the exception handler because 'set_exception_handler()' does send all throwables to the handler, not only exceptions. Why this is a problem for TYPO3? How they use set_exception_handler() that catching

Re: [PHP-DEV] set_exception_handler catches all Throwables

2015-08-19 Thread Stanislav Malyshev
Hi! 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

Re: [PHP-DEV] set_exception_handler catches all Throwables

2015-08-19 Thread Anthony Ferrara
Stas and all, On Wed, Aug 19, 2015 at 2:45 PM, Stanislav Malyshev smalys...@gmail.com wrote: Hi! 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

Re: [PHP-DEV] set_exception_handler catches all Throwables

2015-08-19 Thread Peter Cowburn
On 17 August 2015 at 15:24, Sebastian Bergmann sebast...@php.net wrote: Am 17.08.2015 um 16:00 schrieb Derick Rethans: 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()

[PHP-DEV] set_exception_handler catches all Throwables

2015-08-17 Thread Christian Weiske
Hi, We're trying to use TYPO3 on PHP7 and have the problem that throwables get passed to the exception handler because 'set_exception_handler()' does send all throwables to the handler, not only exceptions. Is this intended, or should a set_throwable_handler() function be introduced instead?

Re: [PHP-DEV] set_exception_handler catches all Throwables

2015-08-17 Thread Niklas Keller
This is intended and documented here: http://php.net/manual/en/function.set-exception-handler.php Regards, Niklas 2015-08-17 12:31 GMT+02:00 Christian Weiske cwei...@cweiske.de: Hi, We're trying to use TYPO3 on PHP7 and have the problem that throwables get passed to the exception handler

Re: [PHP-DEV] set_exception_handler catches all Throwables

2015-08-17 Thread Christian Weiske
Hello Niklas, 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

Re: [PHP-DEV] set_exception_handler catches all Throwables

2015-08-17 Thread Derick Rethans
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

Re: [PHP-DEV] set_exception_handler catches all Throwables

2015-08-17 Thread Sebastian Bergmann
Am 17.08.2015 um 16:00 schrieb Derick Rethans: 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