Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87059 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41999 invoked from network); 7 Jul 2015 01:25:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Jul 2015 01:25:34 -0000 Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.163 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.163 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.163] ([81.169.146.163:14491] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/42-21549-98A2B955 for ; Mon, 06 Jul 2015 21:25:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1436232326; l=7778; s=domk; d=kelunik.com; h=Content-Type:Cc:To:From:Subject:Date:References:In-Reply-To: MIME-Version; bh=lu8GFhNNtU62ZwbGuqVhim5uLW3c4bQ8yuvAAnhz2gg=; b=J3/ZqiDuI/NMpWgmlP7ReFbTKiSfhd3mw4LWP8q4mZsJYJFThiQQ979NzQqQjyaAtcs Hxgi0czsWLlSV28fMX9O9rW9cUJxF5PdUX3N8tVQiBCHSa0/KFutqgS3fTAlkH7/jaTjq GOM0XW1AsfL41ByQnnYu0OCvU5EbaD13KVI= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLDup6E67mzuoBMBqDwses= X-RZG-CLASS-ID: mo00 Received: from mail-ie0-f181.google.com ([209.85.223.181]) by smtp.strato.de (RZmta 37.8 AUTH) with ESMTPSA id h05845r671PQs3w (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate) for ; Tue, 7 Jul 2015 03:25:26 +0200 (CEST) Received: by iecuq6 with SMTP id uq6so124966165iec.2 for ; Mon, 06 Jul 2015 18:25:25 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.107.46.159 with SMTP id u31mr2494822iou.69.1436232325132; Mon, 06 Jul 2015 18:25:25 -0700 (PDT) Received: by 10.64.115.70 with HTTP; Mon, 6 Jul 2015 18:25:25 -0700 (PDT) In-Reply-To: References: <7D73A3C7-F694-497B-9A9D-4F375F86B6A0@icicle.io> Date: Tue, 7 Jul 2015 03:25:25 +0200 Message-ID: To: Pierre Joye Cc: Aaron Piotrowski , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a113ad1c68dfbcb051a3ee56d Subject: Re: [PHP-DEV] Error Subclasses From: me@kelunik.com (Niklas Keller) --001a113ad1c68dfbcb051a3ee56d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2015-07-07 2:22 GMT+02:00 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 > 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 th= e > 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 tryin= g > 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 we= ll as > updating all the related tests: > https://github.com/trowski/php-src/tree/error-subclasses < > 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 speci= fy > 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 o= f > Errors are thrown from conditions that were already throwing Error object= s. > > Very good job! Thanks. > > > I was hoping this could be merged before beta 1, though I=E2=80=99m not= sure 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, > -- > Pierre > > @pierrejoye | http://www.libgd.org > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > I'm with Anatol here. It's no BC break if we only introduce subtypes instead of the parent type, but it would be a BC break afterwards if the names we choose now do not then. It feels pretty rushed to get it in before beta1 (which is the final feature freeze). As errors shouldn't be caught except for logging, there's also little benefit in rushing in subtypes them now. The only benefit that I can see is the exception name as a short and concise error description. It's nothing like Throwable, which needed that exception, because a later introduction would have been a BC break. Regards, Niklas --001a113ad1c68dfbcb051a3ee56d--