Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87045 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74103 invoked from network); 6 Jul 2015 10:06:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jul 2015 10:06:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=anatol.php@belski.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=anatol.php@belski.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain belski.net from 85.214.73.107 cause and error) X-PHP-List-Original-Sender: anatol.php@belski.net X-Host-Fingerprint: 85.214.73.107 klapt.com Received: from [85.214.73.107] ([85.214.73.107:47136] helo=h1123647.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1A/4A-21549-B235A955 for ; Mon, 06 Jul 2015 06:06:36 -0400 Received: by h1123647.serverkompetenz.net (Postfix, from userid 1006) id 0573623D629F; Mon, 6 Jul 2015 12:06:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on h1123647.serverkompetenz.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.5 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable version=3.3.2 Received: from w530phpdev (p579F31E5.dip0.t-ipconnect.de [87.159.49.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by h1123647.serverkompetenz.net (Postfix) with ESMTPSA id E06E223D615B; Mon, 6 Jul 2015 12:06:29 +0200 (CEST) To: "'Aaron Piotrowski'" , References: <7D73A3C7-F694-497B-9A9D-4F375F86B6A0@icicle.io> In-Reply-To: <7D73A3C7-F694-497B-9A9D-4F375F86B6A0@icicle.io> Date: Mon, 6 Jul 2015 12:06:34 +0200 Message-ID: <0ca201d0b7d3$72697240$573c56c0$@belski.net> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQGdf19uUjzsqNYBQsS3JK6NDnjPep40pGvw Content-Language: en-us Subject: RE: [PHP-DEV] Error Subclasses From: anatol.php@belski.net ("Anatol Belski") Hi Aaron, > -----Original Message----- > From: Aaron Piotrowski [mailto:aaron@icicle.io] > Sent: Monday, July 6, 2015 8:16 AM > To: internals@lists.php.net > Subject: [PHP-DEV] Error Subclasses >=20 > Hello everyone! >=20 > I recently pushed changes that eliminated E_EXCEPTION and allows an > exception type to be provided for what were fatals in PHP, while still = falling back > to an E_ERROR if necessary. >=20 > Since more specific Error classes can be thrown, I'd like to propose = the following > additions to the Error tree of exceptions: AccessError and = IdentifierError. >=20 > 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. >=20 > 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 > >=20 > This patch also broadens the usage of TypeError to include conditions = such 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 = incorrect type > that otherwise are throwing plain Error objects. >=20 > This patch introduces no functional changes, only more specific types = of Errors > are thrown from conditions that were already throwing Error objects. >=20 > I was hoping this could be merged before beta 1, though I=E2=80=99m = not sure if the time > table is too tight. >=20 Thanks for the ping. While I find the idea about more specific = exceptions correct, I would not recommend merging it in beta1. Reason - = we have no big time now to verify the patch completeness, to discuss the = exception names and areas where it's applicable. IMHO if it goes in, it has to be complete and well verified, maybe also = voted (regarding namings). As the area is very public and if we find any = issues later and have to rename/rework the exception names, etc. - it = would be bad. So 7.1 might be a better place to target. Technically it = would be anyway worky as those specialized extension classes will have = the same parent. Regards Anatol