Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87803 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16974 invoked from network); 19 Aug 2015 14:20:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Aug 2015 14:20:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=bjorn.x.larsson@telia.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=bjorn.x.larsson@telia.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain telia.com from 81.236.60.154 cause and error) X-PHP-List-Original-Sender: bjorn.x.larsson@telia.com X-Host-Fingerprint: 81.236.60.154 v-smtpout1.han.skanova.net Received: from [81.236.60.154] ([81.236.60.154:50043] helo=v-smtpout1.han.skanova.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EF/A9-54915-DA094D55 for ; Wed, 19 Aug 2015 10:20:31 -0400 Received: from [172.20.10.4] ([95.195.195.61]) by cmsmtp with SMTP id S4E6ZHNZz9HQVS4E6Zoxsw; Wed, 19 Aug 2015 16:20:26 +0200 To: Ryan Pallas References: <20150817123142.13418f26@csystems> <20150817131900.66906015@csystems> <55D1EE8E.9030603@php.net> <55D45278.5050005@telia.com> <55D479F1.5000408@telia.com> Cc: PHP internals Message-ID: <55D490AB.7030507@telia.com> Date: Wed, 19 Aug 2015 16:20:27 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------080402010002060407080102" X-CMAE-Envelope: MS4wfJ+M1wXEmPtMS6yyI9urnhASpoEDa3GVYafA8radmHlycL+/B8Px1RVaxAeZJ3ihWRxqhVv2b906WbAy/HkmUmjADI2UHkratxjiCz6C0kVMRBPaxSKvbA3yVmKdhZTH7osiYxJZs9cT7pHuZlfIwit7qSaUoKiy+ZCDx9cBqc9ye+zPrSDLY5egWbP+xRhrOwUWd3rAX6rheuZP8rZWbC0= Subject: Re: [PHP-DEV] set_exception_handler catches all Throwables From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) --------------080402010002060407080102 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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, 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 recipients. Will look into it more later. > > > > Regards, //Björn > > > > > > Den 2015-08-19 kl. 13:30, skrev 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 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 changed - with my > >> preference it not > >> capturing Error, and instead have an additional > >> set_throwable_handler(). > >> > >> +1 > >> > 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 until 8 if I understand correctly. > This is also a view that I share, feels more consistent that the handler mimics v5 and catch(Exception $e) behaviour. Hope there can be a decision / consensus on this topic. Regards //Björn --------------080402010002060407080102--