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 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 my preference

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 set_throwable_handle

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 Adam Harvey
On 19 August 2015 at 07:20, Björn Larsson 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 this is an oversight

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" > 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, n

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 ch

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" 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 callback, but could

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 recipien

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 : > Den 2015-08-19 kl. 10:52, skrev Peter Cowburn: > >> On 17 August 2015 at 15:24, Sebastian Berg

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 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,

Re: [PHP-DEV] set_exception_handler catches all Throwables

2015-08-19 Thread Peter Cowburn
On 17 August 2015 at 15:24, Sebastian Bergmann 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() should be cha

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 inste

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

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 hierarch

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 : > Hi, > > > We're trying to use TYPO3 on PHP7 and have the problem that throwables > get passed to the exception handler because 'set_ex

[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 behaviour change...

2004-08-31 Thread Andi Gutmans
Amen :) At 09:03 PM 8/31/2004 +0200, Marcus Boerger wrote: Hello Davey, Tuesday, August 31, 2004, 8:41:45 AM, you wrote: > Dear all, > I would like to request that set_exception_handler's behaviour be > changed. IMHO it should not die after handling an exception. An exception means that the current

Re: [PHP-DEV] set_exception_handler behaviour change...

2004-08-31 Thread Andi Gutmans
Hi Davey, You should use try/catch in order to catch exceptions. set_exception_handler() is only meant for you to be able to handle uncaught exception before PHP dies (i.e.allow you to output an error message page). I think your idea goes very much against what exceptions stand for which is allo

Re: [PHP-DEV] set_exception_handler behaviour change...

2004-08-31 Thread Marcus Boerger
Hello Davey, Tuesday, August 31, 2004, 8:41:45 AM, you wrote: > Dear all, > I would like to request that set_exception_handler's behaviour be > changed. IMHO it should not die after handling an exception. An exception means that the current execution block cannot be continued and incase that

[PHP-DEV] set_exception_handler behaviour change...

2004-08-30 Thread Davey
Dear all, I would like to request that set_exception_handler's behaviour be changed. IMHO it should not die after handling an exception. I feel that most users will expect this behaviour to be synonymous (i.e. both should echo "foo"): try { throw someException; } catch (someException $e) { }

Re: [PHP-DEV] set_exception_handler()

2004-04-03 Thread Andi Gutmans
Never mind. I checked the source and saw what I was looking for (that the handler also preserves the object instance and not just the method itself). I applied your patch. Thanks. At 11:34 PM 4/3/2004 +0200, Timm Friebe wrote: On Sat, 2004-04-03 at 21:26, Andi Gutmans wrote: > In general, I have

Re: [PHP-DEV] set_exception_handler()

2004-04-03 Thread Timm Friebe
On Sat, 2004-04-03 at 21:26, Andi Gutmans wrote: > In general, I have no problem with adding this consistency. > Where is a reference to $instance held until the exception occurs? What kind of reference? This is what I used to verify the (instance) functionality: prefix, get_class($e),

Re: [PHP-DEV] set_exception_handler()

2004-04-03 Thread Andi Gutmans
In general, I have no problem with adding this consistency. Where is a reference to $instance held until the exception occurs? I took a quick look and couldn't see it but I'm probably missing something. Andi At 08:13 PM 4/3/2004 +0200, Timm Friebe wrote: Hello, I wanted to check back on the sta

[PHP-DEV] set_exception_handler()

2004-04-03 Thread Timm Friebe
Hello, I wanted to check back on the status of my patch to zend_builtin_functions.c I sent a while ago. It changes set_exception_handler() to accept the pseudo-type "callable" (instead of a string referring to a global function). Examples: set_exception_handler('function_name'); set_exception