Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84671 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81436 invoked from network); 13 Mar 2015 09:36:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Mar 2015 09:36:29 -0000 Authentication-Results: pb1.pair.com header.from=patrickallaert@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=patrick.allaert@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.172 as permitted sender) X-PHP-List-Original-Sender: patrick.allaert@gmail.com X-Host-Fingerprint: 74.125.82.172 mail-we0-f172.google.com Received: from [74.125.82.172] ([74.125.82.172:39525] helo=mail-we0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D6/DD-24603-C9FA2055 for ; Fri, 13 Mar 2015 04:36:28 -0500 Received: by wevl61 with SMTP id l61so21997512wev.6 for ; Fri, 13 Mar 2015 02:36:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=EOKL0SdNIcZZoZK3TOq1XIo7oC3dOIIfRTZ1nVI1Czc=; b=Mxk8GrseSgLdIAy976k54Fx52k4TWXufDDiLi20wWwy/jQvZspe4mkoOU21xw68nR+ /4n1CohrCWyxBhwDKkjUrVqDfY+RmEigCiGjZlzeHGyfGaYzxoqP3xZDpMbfqAiQyYa7 +U3ay/0lexz3o5NJJ6JHjRTTrkLdZtgBimY34Xob8In9dq+0+zrNl6tuh7mb9Ml6rDed CgfKmXxJImQe724K/bCm5EZorSDSo3iAT9sLBErEyq9GBHi+mUSw9163nAfLHxafbm5/ /jHYuqIKC623z6vPMMPvTickGgTgUHodKBY99ZSq2Cy88Cj8oKx06xNlT7KH+LiYrawk +DYQ== X-Received: by 10.180.8.10 with SMTP id n10mr93872877wia.79.1426239385808; Fri, 13 Mar 2015 02:36:25 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 13 Mar 2015 09:36:25 +0000 Message-ID: To: Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary=14dae9cc97c8f4b9a40511283bb3 Subject: Re: [PHP-DEV] Reclassify E_STRICT notices From: patrickallaert@php.net (Patrick ALLAERT) --14dae9cc97c8f4b9a40511283bb3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Le ven. 13 mars 2015 =C3=A0 10:33, Patrick ALLAERT = a =C3=A9crit : > Hi Nikita, > > Le dim. 22 f=C3=A9vr. 2015 =C3=A0 23:31, Nikita Popov a > =C3=A9crit : > > Hi internals! >> >> I would like to propose reclassifying our few existing E_STRICT notices >> and >> removing this error category: >> >> https://wiki.php.net/rfc/reclassify_e_strict >> >> As we don't really have good guidelines on when which type of error shou= ld >> be thrown, I'm mainly going by what category other similar errors use. I= 'm >> open to suggestions, but hope this will not deteriorate into total >> bikeshed. >> >> Thanks, >> Nikita >> > > I am *very* glad you bring this subject on the table and I fully agree > with the overall picture, I yet have to see the details as soon as I have > some time. > > Just a remark regarding E_STRICT: since its introduction in PHP 5.0, it > provided a way for people migrating from 4.x to 5.x with error_reporting = =3D > E_ALL to focus on the conversion of existing (legacy) application, while > not forcing people to take care of changing things that "worked before bu= t > are now considered not so good" (yaaaaayyy, BC!). > At the same time, people developing new applications could (via opt-in!) > enjoy some more strictness thanks to this flag by adding it to the > error_reporting. > > A few versions/years later, PHP 5.4 integrated E_STRICT as part of E_ALL > and it encourages people to give attention to E_STRICT in addition to the > other levels. > > However, we are again a bit in the same situation now: how could we > provide extra information to PHP 7.x users (via opt-in) about things that > we consider bad practice/behaviour abuse/side effect, but that will > continue to work? E_DEPRECATED may sound fine, but not always as it *impl= y* > the feature will be gone some day. > > Could you think about this as this is somewhat related to E_STRICT histor= y? > > A possible option (to investigate) would be to combine the various error > levels with a new flag (E_NEW?): > > zend_error(E_WARNING | E_NEW, "This is a new warning as of 7.0!"); > > For BC: > People having E_WARNING as part of their error_reporting without > activating E_NEW would not see it. Think about this as: it's PHP 5.0 with > error_reporting =3D E_ALL (without E_STRICT then). > > For more errors verbosity (new application development): > One can activate E_ALL reporting > FIX: s/activate E_ALL reporting/activate E_NEW reporting/ > (error_reporting =3D E_ALL | E_NEW or something else which doesn't expose > the E_NEW flag ?) in order to see all new notices/warnings/... > > Later, instead of activating E_NEW by default (like including E_STRICT in > E_ALL), the idea would be to remove the flag where appropriate so that: > > zend_error(E_WARNING, "This is a new warning as of 7.0!"); > > What's your opinion about this? (as a feature, not focusing on the > details). > > Thanks, > Patrick > --14dae9cc97c8f4b9a40511283bb3--