Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87058 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36648 invoked from network); 7 Jul 2015 00:22:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Jul 2015 00:22:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.173 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.220.173 mail-qk0-f173.google.com Received: from [209.85.220.173] ([209.85.220.173:33668] helo=mail-qk0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9F/D1-21549-6CB1B955 for ; Mon, 06 Jul 2015 20:22:31 -0400 Received: by qkhu186 with SMTP id u186so129503968qkh.0 for ; Mon, 06 Jul 2015 17:22:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=boSXpDvOUAghyq/LE/roUPbDg7gueiNNQcXV1qdGIx0=; b=Ct26autGZz6m/x777rw7GEePbYZwMzByX44KWayD895XlgjJOkfbSz9D73eL5zlsDx 5DhKAGz8AQpIaH8O5jdfMYKV/EQN1li3kqC4VQH3Qqh4HIHRSjPUI9l2oU08//Cc0L04 NjVDt6YAP5PsA9WfMCf1OEsyQizd5RMaHwIAzsdAy3Yq0kCenuYjRtKXVvxpypXjY8xk Ozc6tpnKPDOCquvT1GWEBj8g8c1uh5sed3kKdIKl8Vp1q22b5NIwRTkOr5dqb2fCRQW8 l0uEdiia21hT9OV3tC+YbZ/MGrBPMS1HIL4l9sxuDXhpanby7BMGHKIMKHQbL951tIEI pyAQ== MIME-Version: 1.0 X-Received: by 10.55.20.166 with SMTP id 38mr2674001qku.12.1436228547514; Mon, 06 Jul 2015 17:22:27 -0700 (PDT) Received: by 10.96.154.195 with HTTP; Mon, 6 Jul 2015 17:22:27 -0700 (PDT) In-Reply-To: <7D73A3C7-F694-497B-9A9D-4F375F86B6A0@icicle.io> References: <7D73A3C7-F694-497B-9A9D-4F375F86B6A0@icicle.io> Date: Tue, 7 Jul 2015 07:22:27 +0700 Message-ID: To: Aaron Piotrowski Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Error Subclasses From: pierre.php@gmail.com (Pierre Joye) hi Aaron, On Mon, Jul 6, 2015 at 1:15 PM, Aaron Piotrowski wrote: > Hello everyone! > > I recently pushed changes that eliminated E_EXCEPTION and allows an excep= tion type to be provided for what were fatals in PHP, while still falling b= ack to an E_ERROR if necessary. > > Since more specific Error classes can be thrown, I'd like to propose the = following additions to the Error tree of exceptions: AccessError and Identi= fierError. > > AccessError - Thrown when trying attempting to call a public, private, or= abstract method, when statically calling a non-static method, or trying to= use self::, parent::, or static:: outside of a class. > IdentifierError - Thrown when referencing an undefined function, method, = class, constant, etc. > > I=E2=80=99ve created a patch that implements the exceptions above as well= as updating all the related tests: https://github.com/trowski/php-src/tree= /error-subclasses > > This patch also broadens the usage of TypeError to include conditions suc= h as calling a method on a scalar, passing a value that does not specify a = callback when one is expected, and various other conditions based on an inc= orrect type that otherwise are throwing plain Error objects. > > This patch introduces no functional changes, only more specific types of = Errors are thrown from conditions that were already throwing Error objects. Very good job! Thanks. > I was hoping this could be merged before beta 1, though I=E2=80=99m not s= ure if the time table is too tight. In any case you may like to start a RFC already, no matter if which versions it targets. About 7.0 in general, naming and conventions are something I like to see solved in 7.0. I do not think it affects stability in any way and should not delay the final release date. One argument in favor of such exceptions (if approved by RFC votes) is that dealing with such changes or additions for the core languages in minor versions is somehow more painful for our users. In any case, please go for a RFC and see what gets out of it :) Cheers, --=20 Pierre @pierrejoye | http://www.libgd.org