Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87047 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87307 invoked from network); 6 Jul 2015 12:59:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jul 2015 12:59:21 -0000 Authentication-Results: pb1.pair.com header.from=bobwei9@hotmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=bobwei9@hotmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.com designates 65.55.111.164 as permitted sender) X-PHP-List-Original-Sender: bobwei9@hotmail.com X-Host-Fingerprint: 65.55.111.164 blu004-omc4s25.hotmail.com Received: from [65.55.111.164] ([65.55.111.164:55548] helo=BLU004-OMC4S25.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/AB-21549-8AB7A955 for ; Mon, 06 Jul 2015 08:59:21 -0400 Received: from BLU437-SMTP10 ([65.55.111.137]) by BLU004-OMC4S25.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Mon, 6 Jul 2015 05:59:17 -0700 X-TMN: [6eb7GPlsiV9NR/hphJSmTILY/CWy/0JK] X-Originating-Email: [bobwei9@hotmail.com] Message-ID: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) In-Reply-To: <0ca201d0b7d3$72697240$573c56c0$@belski.net> Date: Mon, 6 Jul 2015 14:59:12 +0200 CC: Aaron Piotrowski , internals@lists.php.net Content-Transfer-Encoding: quoted-printable References: <7D73A3C7-F694-497B-9A9D-4F375F86B6A0@icicle.io> <0ca201d0b7d3$72697240$573c56c0$@belski.net> To: Anatol Belski X-Mailer: Apple Mail (2.2098) X-OriginalArrivalTime: 06 Jul 2015 12:59:15.0336 (UTC) FILETIME=[8FE91880:01D0B7EB] Subject: Re: [PHP-DEV] Error Subclasses From: bobwei9@hotmail.com (Bob Weinand) Hey Anatol > Am 06.07.2015 um 12:06 schrieb Anatol Belski : >=20 > Hi Aaron, >=20 >> -----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. >=20 > 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. >=20 > Regards >=20 > Anatol I like what Aaron did here. I really think that should target 7.0. It's actually not breaking = anything (really just changing the exception names). And I really think we should have a proper Error hierarchy at the = release of PHP 7.0. Considering it especially one of *the* features of = 7.0. But I think, at end of beta 2 or so, we really should do a final review = of all the Errors in order to ensure everything is aptly named and used. Bob=