Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86662 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39749 invoked from network); 15 Jun 2015 14:53:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jun 2015 14:53:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.160.180 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.160.180 mail-yk0-f180.google.com Received: from [209.85.160.180] ([209.85.160.180:36533] helo=mail-yk0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 01/F2-25272-4E6EE755 for ; Mon, 15 Jun 2015 10:53:25 -0400 Received: by ykaz81 with SMTP id z81so58347747yka.3 for ; Mon, 15 Jun 2015 07:53:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=J8TwyBobVaiSm9XJt9LGZn8g1+4CWsP2Ohqj9ONaBlA=; b=A51fAUDMJm73bgIBGia1vQTrwQtb1+j4yRWvxtjiRAhHUvVtJbR9MnkBA4IpTdjNhH NkoiUBViCemi++X+b2SI2hR3e+Zr6LoVRe94pdxQRU7oM/t16QO0MqSHwj4kjB5A/zOj pbuL+5ry9lIMe2AeDK+w8tWtopOtd8yHcHJ7kDCk7seFV9ba5vpr8X3tXZrcNGKBm6ri bCqiP0ytFGNPcD7xTZAeSA9jYUFp6tLy9GxrY62KNI6uQFSpEeql83JQLMPx/kRkqXbh tt9Nl7+wPMvV0Fuhj+hcMj2QvphWo4TKtQ7wgM/VTlVpXfluut+8Kb+/XsXYU1m/fyA5 pPkg== X-Gm-Message-State: ALoCoQk1muUI7BX+6oPXq1c3xE+ttVW/AuzZL9oqv5wAQWD5BL1jKIfTUK9ToEWNlRgf8fXJEs5YAJ9iKpNGNAZgqSkDrdGoYjvoun5ah9sYAjn7nC9nc+R+mxXtROIDDgUbLv9X1HHNdJNzLogf3Wd8qp74aYS4uF4kHAw31oxFE126VrXytug= MIME-Version: 1.0 X-Received: by 10.52.228.42 with SMTP id sf10mr40801601vdc.12.1434380002192; Mon, 15 Jun 2015 07:53:22 -0700 (PDT) Received: by 10.31.10.201 with HTTP; Mon, 15 Jun 2015 07:53:22 -0700 (PDT) In-Reply-To: <36F7469F-7D86-43F6-ABC7-9252DF707BFC@icicle.io> References: <971AB39D-1E20-43E8-9CF1-A7F67E3C14C3@icicle.io> <556363D3.1040902@gmail.com> <12C3389A-AFF5-42CA-8190-E4227309DAED@icicle.io> <016201d0a6bf$96e37dc0$c4aa7940$@belski.net> <0A4CC87D-2E54-4202-9AA2-22856F0B6011@icicle.io> <008701d0a762$4348c320$c9da4960$@belski.net> <36F7469F-7D86-43F6-ABC7-9252DF707BFC@icicle.io> Date: Mon, 15 Jun 2015 17:53:22 +0300 Message-ID: To: Aaron Piotrowski , Nikita Popov Cc: Anatol Belski , PHP Internals Content-Type: multipart/alternative; boundary=089e01184d7a810d5f05188f9e56 Subject: Re: [PHP-DEV] [RFC] Throwable Interface From: dmitry@zend.com (Dmitry Stogov) --089e01184d7a810d5f05188f9e56 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Jun 15, 2015 at 4:55 PM, Aaron Piotrowski wrote: > > On Jun 15, 2015, at 6:56 AM, Anatol Belski wrote: > > Hi Dmitry, > > -----Original Message----- > From: Dmitry Stogov [mailto:dmitry@zend.com ] > Sent: Monday, June 15, 2015 10:53 AM > To: Aaron Piotrowski > Cc: Anatol Belski; PHP Internals > Subject: Re: [PHP-DEV] [RFC] Throwable Interface > > Hi, > > I made a quick code review, and I don't see any technical problems in > implementation. > > 1) Anyway, I think it's a bad idea to rename "EngineException" (and > others) into > "Error"(s). > This will prevent using class "Error" in applications, and may potentiall= y > break > some of them. > I also don't like renaming in ~440 tests (I didn't review all these > changes). > > 2) I think it's better to move "zend_ce_throwable" > definition/initialization from zend_interfaces.h/c into zend_exception.h/= c. > At least, this will allow arg_info reuse. (it's missed now, but should be > added > now or in the future). > > 3) In ext/simplexml/tests/SimpleXMLElement_xpath_3.phpt EngineExcpetion i= s > not renamed into Error. > > Thanks for the review. I've also tested the branch which has today's > master merged in, by now it doesn't show any functional regression. > > Actually I part your first concern about Error. Spent some time phishing > for "class Error" on github and found three apps doing this without > namespace. But that's from 100 search result pages. And those three apps > are forked zero to 1 times, so pretty much low usage. This will likely > break more in the world, we hardly know. > > The current RFC can't be changed while in voting. But how it looks like, > the principle of the Trowable RFC is something everyone agrees on. Maybe = do > another RFC in parallel for better names? Still I'd stand for taking it > into alpha2 - if we want to have it, better to arrange it in a way that i= t > doesn't cause unnecessary delays in the release process. > > > > Hi Dmitry and Anatol, > > I fixed three more tests that were missed when merging, as I only checked > those > that failed after the merge. I should have used find and replace again > after the > merge, which is how I changed the majority of the tests. Only a few tests > required > manual changes, mostly because of hard-coded string lengths, and one or t= wo > tests used the class name Error. Note that Nikita recently changed nearly > all > these tests and many others when updating the phrasing on uncaught > exception > messages. While many tests were changed, users won=E2=80=99t have such is= sues > because they aren=E2=80=99t catching these exceptions yet. > > Would you like me to move zend_ce_throwable to zend_exceptions.h/c or is > that > something you=E2=80=99d take care of after the merge? > I don't care about this a lot. I just think it's better. If you don't see any problems, please, move the code. > I am strongly against naming something _____Exception if it doesn=E2=80= =99t extend > Exception. This was most of the point of the RFC, as I find code such as > `catch (Exception $e) { =E2=80=A6 } catch (EngineException) { =E2=80=A6 }= ` very > unintuitive and I > feel it will lead to confusion for users. > > I sifted through search results on GitHub looking for usage of Error befo= re > proposing the RFC and also found only a couple of actual uses from > generally > unused projects. Most of the other results are forks of an old version of > PHPUnit. > Namespaces have been around long enough that most libraries and apps will > not > have such a class in the root namespace. As far as BC breaks go, renaming= a > class in an app is a fairly trivial one to make, and one that very, very > few people > will have to do. I feel having a simple name such as Error is more > important than > avoiding naming conflicts with a very small amount of code. > Nikita, what is your opinion? If you don't care, I won't as well. Thanks. Dmitry. > > Regards, > Aaron Piotrowski > > --089e01184d7a810d5f05188f9e56--