Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87038 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38579 invoked from network); 6 Jul 2015 06:15:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jul 2015 06:15:58 -0000 Authentication-Results: pb1.pair.com header.from=aaron@icicle.io; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=aaron@icicle.io; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain icicle.io designates 199.38.81.6 as permitted sender) X-PHP-List-Original-Sender: aaron@icicle.io X-Host-Fingerprint: 199.38.81.6 mercury.negativeion.net Received: from [199.38.81.6] ([199.38.81.6:53226] helo=mercury.negativeion.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 37/27-21549-C1D1A955 for ; Mon, 06 Jul 2015 02:15:56 -0400 Received: from localhost (localhost [127.0.0.1]) by mercury.negativeion.net (Postfix) with ESMTP id 304472786069 for ; Mon, 6 Jul 2015 02:15:53 -0400 (EDT) X-Virus-Scanned: amavisd-new at negativeion.net Received: from mercury.negativeion.net ([127.0.0.1]) by localhost (mercury.negativeion.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JLz7B3kf5vu9 for ; Mon, 6 Jul 2015 02:15:52 -0400 (EDT) Received: from mars.local (unknown [173.225.150.231]) by mercury.negativeion.net (Postfix) with ESMTPSA id BE3D92786050 for ; Mon, 6 Jul 2015 02:15:52 -0400 (EDT) Content-Type: multipart/alternative; boundary="Apple-Mail=_5048114B-9C5F-41D2-910A-4C1A7CBB7D63" Message-ID: <7D73A3C7-F694-497B-9A9D-4F375F86B6A0@icicle.io> Date: Mon, 6 Jul 2015 01:15:50 -0500 To: "internals@lists.php.net" Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) X-Mailer: Apple Mail (2.2102) Subject: Error Subclasses From: aaron@icicle.io (Aaron Piotrowski) --Apple-Mail=_5048114B-9C5F-41D2-910A-4C1A7CBB7D63 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hello everyone! 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. 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. 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 = 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. This patch introduces no functional changes, only more specific types of = Errors are thrown from conditions that were already throwing Error = objects. I was hoping this could be merged before beta 1, though I=E2=80=99m not = sure if the time table is too tight. Cheers, Aaron Piotrowski= --Apple-Mail=_5048114B-9C5F-41D2-910A-4C1A7CBB7D63--