Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81305 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40972 invoked from network); 28 Jan 2015 12:13:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jan 2015 12:13:46 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.172 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.212.172 mail-wi0-f172.google.com Received: from [209.85.212.172] ([209.85.212.172:41235] helo=mail-wi0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 49/00-45774-872D8C45 for ; Wed, 28 Jan 2015 07:13:45 -0500 Received: by mail-wi0-f172.google.com with SMTP id h11so11407283wiw.5 for ; Wed, 28 Jan 2015 04:13:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2cMt675FxFsB7hDytLEB9sNamPr0Z5vBg44IYshGXpQ=; b=Fo5t+aHBDXklfRIPLgGyj5qZQcvTXSWBGEeDldQj2AcXP8cq1an/QAH4hxM58xSxVg z0ziF0TgvBNZPVVzv2uHrypFiE8n7w1QtKjSS3ReuSz/3eR8+GNHICbPfDIiNWmVoHgt +0dKRSw2wveFcT6MeD4lbSYxw0VALfinlwoAM7I67rktfIJUjyzY4PY6XCPWov0/mZU6 d1msRf/vSu/qghYO/E7td8t/KcxUxl2Uro5GA8aatQFj77CvK4F8WWO8ECOJqUiL7Cnc F6uwtkO60C4Xkmmfu7RPgCHFHdFezUEXv2DTJ8cpW/Mhwb9pKgl3tudKQVfPmzN8Cd2N btUA== MIME-Version: 1.0 X-Received: by 10.180.7.198 with SMTP id l6mr6630270wia.26.1422447220473; Wed, 28 Jan 2015 04:13:40 -0800 (PST) Received: by 10.180.88.33 with HTTP; Wed, 28 Jan 2015 04:13:40 -0800 (PST) In-Reply-To: <54C8BE99.8070109@gmail.com> References: <54C80F4F.7020905@gmail.com> <011d01d03ab7$dd725c30$98571490$@tekwire.net> <54C8BE99.8070109@gmail.com> Date: Wed, 28 Jan 2015 13:13:40 +0100 Message-ID: To: Rowan Collins Cc: PHP Internals Content-Type: multipart/alternative; boundary=f46d044287c049c583050db54d44 Subject: Re: [PHP-DEV] Proposal: Raise severity of undefined constants From: tyra3l@gmail.com (Ferenc Kovacs) --f46d044287c049c583050db54d44 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Jan 28, 2015 at 11:48 AM, Rowan Collins wrote: > Ferenc Kovacs wrote on 28/01/2015 07:20: > >> >> >> 2015.01.28. 6:04 ezt =C3=ADrta ("Fran=C3=A7ois Laupretre" > >): >> > >> > > De : Rowan Collins [mailto:rowan.collins@gmail.com > rowan.collins@gmail.com>] >> > > I would like to propose that the error given for an undefined consta= nt >> > > should be raised from E_NOTICE, probably to E_RECOVERABLE_ERROR, in >> > > PHP 7. >> > >> > +1 >> > >> >> I don't like that. >> Depending if we want to keep the behavior on the long term I would eithe= r >> go with E_WARNING or E_DEPRECATED >> Turning it into E_RECOVERABLE_ERROR would be for most users just as bad >> as removing it while we still have to support the behavior so no real ga= in >> for us. >> >> > E_DEPRECATED is likely to be even more ignored than E_NOTICE, so would be > a step backwards; my whole assumption is that most people getting the > message are not using a deprecated feature, but accidentally mis-typing a > constant or keyword. I'd be happy with raising it to E_WARNING to make it > more noticeable, though, if we don't think removing the functionality is > acceptable. > > turn it into E_WARNING if we are planning to keep the feature, turn it into E_DEPRECATED if we want to remove the feature later on. > On the other hand, if the concern is having to support it, then it could > just be E_ERROR. The reason I chose E_RECOVERABLE_ERROR is because that h= ad > recently been adopted for other things, such as invalid method calls. As = I > mentioned in my original e-mail, the recovery behaviour needn't be the > existing string interpretation, but could just be to treat the value as > NULL, which would probably be simpler to implement. Personally, I've neve= r > actually recovered an E_RECOVERABLE_ERROR, so am not sure what use cases = we > should be supporting. ok, I was assuming that by turning it into E_RECOVERABLE_ERROR you would still keep the assuming string behavior if there is a custom error handler which returns true for this error. I think if we want to remove the assuming string feature, we should handle it the same way as we handle referencing undefined function call or class reference(and for consistency the same should be considered for "Undefined variable", which is also an E_NOTICE atm). at this point I think I would -1 on removing the assuming this, +0.5 on turning it into E_DEPRECATED and +1 on turning the "Use of undefined constant"/"Undefined variable" errors into E_WARNING. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --f46d044287c049c583050db54d44--