Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87796 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86209 invoked from network); 19 Aug 2015 12:43:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Aug 2015 12:43:34 -0000 Authentication-Results: pb1.pair.com header.from=bjorn.x.larsson@telia.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=bjorn.x.larsson@telia.com; spf=permerror; 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:51137] helo=v-smtpout1.han.skanova.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/26-54915-4F974D55 for ; Wed, 19 Aug 2015 08:43:33 -0400 Received: from [172.20.10.4] ([95.195.195.61]) by cmsmtp with SMTP id S2iGZGtdK9HQVS2iGZoosL; Wed, 19 Aug 2015 14:43:29 +0200 To: Niklas Keller References: <20150817123142.13418f26@csystems> <20150817131900.66906015@csystems> <55D1EE8E.9030603@php.net> <55D45278.5050005@telia.com> Cc: PHP internals Message-ID: <55D479F1.5000408@telia.com> Date: Wed, 19 Aug 2015 14:43:29 +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="------------020608070708050309010408" X-CMAE-Envelope: MS4wfFX1Ff8GPD6EwseVGwvvvu/MRK0+AITdoX3rnUhXttKontW2e8NVy4Ur/TCfWdYlSGpfQMYMp6NGLfpW6JVKznXKg/7xxMP8e4LwXU77z+M02ONW0RZkHLPHmvQBUrgEjwfXlU2PSYQTZi7TtZ2MI8l/E/IToQNKEEHoymeUb14stktJs34h3ZMXQGhT37abYNdBNvpNIMYYaTjb6Z9ly4M= Subject: Re: [PHP-DEV] set_exception_handler catches all Throwables From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) --------------020608070708050309010408 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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 > > What's the plan for set_exception_handler() regarding > Throwables? Seeing as > we're now in the RC release phase I think this bone of > contention should be > resolved one way or another as soon as we can. > > Yes, a "global" function that behaves differently between PHP 5 & 7 is > not optimal in my view. I'm also wondering how to make one handler > managing two different type of situations. @ircmaxwell described it in > *Core functions throwing exceptions in PHP7*: > "Errors signify programmer error, where Exceptions signify > unknown or runtime errors. Meaning that an Error should always be a > problem with your code, but an Exception could be a systems problem, a > user problem or a problem in your code." > > /Cheers //Björn Larsson/ > > PS A bit new to this list but hope to have contributed a little :) > > --------------020608070708050309010408--