Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90535 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26559 invoked from network); 12 Jan 2016 04:47:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jan 2016 04:47:51 -0000 X-Host-Fingerprint: 90.212.143.187 unknown Received: from [90.212.143.187] ([90.212.143.187:21578] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F2/70-22360-57584965 for ; Mon, 11 Jan 2016 23:47:50 -0500 Message-ID: To: internals@lists.php.net References: <5693B6BB.9020607@gmail.com> Date: Tue, 12 Jan 2016 04:47:46 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 90.212.143.187 Subject: Re: [PHP-DEV] Throwable and Error exceptions break existing PHP 5.x code From: ajf@ajf.me (Andrea Faulds) Hi Adam, Adam Harvey wrote: > On 11 January 2016 at 06:05, Rowan Collins wrote: >> Since set_exception_handler() is intended as a last-ditch "something's gone >> very wrong" function anyway, I think it receiving all Throwables makes >> sense, even if the BC break in your scenario is unfortunate. > > Agreed entirely (as I also said last time this came up). I also don't > want a third path involving a set_throwable_handler() or similar; we > have one too many error handling paths already. > > One problematic thing that we _can_ help mitigate is that the first > section of the backward incompatible changes page in the manual starts > with the changes to error and exception handling, but never mentions > this specific issue (type declarations on the exception handler > breaking). That's entirely my fault (I've mentioned it enough in > conference talks that I guess I thought I'd documented it, but > hadn't), and I'll go fix that now. Since functions like that no longer concern just exceptions, but now the broader notion of "throwables", perhaps they should be renamed? It would make sense to me if it were now set_throwable_handler(), with an alias in place for the old name to avoid breaking compatibility. Thanks. -- Andrea Faulds https://ajf.me/