Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90541 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53784 invoked from network); 12 Jan 2016 11:20:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jan 2016 11:20:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.51 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.51 mail-wm0-f51.google.com Received: from [74.125.82.51] ([74.125.82.51:35002] helo=mail-wm0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1B/13-32047-A91E4965 for ; Tue, 12 Jan 2016 06:20:59 -0500 Received: by mail-wm0-f51.google.com with SMTP id f206so248222497wmf.0 for ; Tue, 12 Jan 2016 03:20:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:from:to:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=5zPzNIE1aMC2MqfIxojUglLUrWyKydV/9N2ME8keqdc=; b=M0dF6GVI2ZsNqbuXO6cCPpkVSW+amEx+u38oZEF1wT9YNlnq3ng4jauwkt2hW1A39F uXOpDUa9b/pmdOLw0mzIel0aWeCsB4bCH4zgrGDzp5VcXh9FjiXuFlxc+pCenw6IwFZe oDKr3335uE+3NyiDB58P/noyRU2UCKyLAEBRN6UfT0kZOlTWFo+5uac6PZPkuy2awLe7 /S54b5M0iyD2xJ2Qsix8IlAM4bnbaJ2d9Ebxt+k84wrlV7X+Tebrbybp/MOFhsHsz8yv Y11GTVMxp9eajiOydxa3mexFp1i8UUZVSJ8fckd0KACwQ7XRUmJ+xZYqjTT78DtlMYvN cl4w== X-Received: by 10.28.171.135 with SMTP id u129mr17768585wme.99.1452597655706; Tue, 12 Jan 2016 03:20:55 -0800 (PST) Received: from [192.168.0.141] ([93.188.182.58]) by smtp.googlemail.com with ESMTPSA id b127sm17019159wmh.9.2016.01.12.03.20.54 for (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Jan 2016 03:20:55 -0800 (PST) References: <5693B6BB.9020607@gmail.com> To: internals@lists.php.net Message-ID: <5694E119.3070308@gmail.com> Date: Tue, 12 Jan 2016 11:18:49 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Throwable and Error exceptions break existing PHP 5.x code From: rowan.collins@gmail.com (Rowan Collins) Giovanni Giacobbi wrote on 12/01/2016 09:37: > But the fact is that it did NOT exist, so when you say "other than the > specific transition to PHP 7", well I think it is a big deal and > motivates the introduction of a new feature just for that. I guess what I meant was, once everyone has been using PHP 7 for years, it would be a shame to have features lying around in the language that existed only to ease the transition, and aren't even "legacy" in the sense of matching PHP 5. > 1) Check the handler's signature compatibility before calling it. > Indeed there is no reason to fix a my_hnd(Exception $e) and not a > my_hnd(ExceptionA $e) where class ExceptionA extends Exception, so > this proposal would be to simply ignore the set_handler_exception()'s > callback if it is not compatible, or maybe even better issue an > E_NOTICE or E_STRICT in such case. I like this idea. Although I can't think of many cases outside the transition where it would be deliberately used, generating a fatal error when calling an error handler is not particular helpful, so just falling through and acting as though no handler existed would seem like a more useful fallback. I don't know how simple it would be to implement in the engine though... Just on a general point, there's actually surprisingly *few* BC breaks in PHP 7, in my opinion. I don't think it's fair to extrapolate from this a "general attitude to the community" - I think it's an unfortunate BC break which could have had more attention, either to ensure it was clearly signalled, or to look at mitigation ideas like we are in this thread. An honest mistake, rather than somebody not caring. Regards, -- Rowan Collins [IMSoP]