Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81299 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28965 invoked from network); 28 Jan 2015 10:49:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jan 2015 10:49:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.182 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:64993] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8A/CD-45774-ABEB8C45 for ; Wed, 28 Jan 2015 05:49:30 -0500 Received: by mail-wi0-f182.google.com with SMTP id n3so10886812wiv.3 for ; Wed, 28 Jan 2015 02:49:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=O6iRKQD7P+tCcM64GU8FCRYJc7GahktiOJavJZB7VLM=; b=Ztq4t+SN9NMAeTIOyx0DMIIoUwW23fCXYxu/+bLO4oUwiBpG4DrG2sXOyDnBUbgg6M K9pbpnmIONW6sHQBqXw9x5S+rzdUcG/T0JExDIKoVQC4iYibyUK45O5xEnBEJFrWeePf ixjLhNppWt79fSPT0RJK8Ldr8XUlY509ZYe4286i51aRTfEbiHTrMjxVQGdjk4WOlS1z q5tc3gK0dvqSPSGwZP6jGP6OT4X+SgC28bY3bgw1m1SrEuylP02QIFuap2OHYfRUA6OL B4NzWeoIiCxQTGKdVikKfbq+LdRbgca/So3ob6xqR4VaVN7Ce8Y3VipFnFkjruhs5/TL v3oA== X-Received: by 10.194.190.162 with SMTP id gr2mr6024290wjc.13.1422442165999; Wed, 28 Jan 2015 02:49:25 -0800 (PST) Received: from [192.168.0.172] ([62.189.198.114]) by mx.google.com with ESMTPSA id w16sm2225642wia.15.2015.01.28.02.49.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jan 2015 02:49:25 -0800 (PST) Message-ID: <54C8BE99.8070109@gmail.com> Date: Wed, 28 Jan 2015 10:48:57 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: PHP Internals References: <54C80F4F.7020905@gmail.com> <011d01d03ab7$dd725c30$98571490$@tekwire.net> In-Reply-To: Content-Type: multipart/alternative; boundary="------------070206010401020308060105" Subject: Re: [PHP-DEV] Proposal: Raise severity of undefined constants From: rowan.collins@gmail.com (Rowan Collins) --------------070206010401020308060105 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Ferenc Kovacs wrote on 28/01/2015 07:20: > > > 2015.01.28. 6:04 ezt írta ("François Laupretre" >): > > > > > De : Rowan Collins [mailto:rowan.collins@gmail.com > ] > > > I would like to propose that the error given for an undefined constant > > > 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 > either 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 gain 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. 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 had 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 never actually recovered an E_RECOVERABLE_ERROR, so am not sure what use cases we should be supporting. Regards, -- Rowan Collins [IMSoP] --------------070206010401020308060105--