Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100553 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40219 invoked from network); 12 Sep 2017 21:32:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Sep 2017 21:32:34 -0000 Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.17.22 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.17.22 mout.gmx.net Received: from [212.227.17.22] ([212.227.17.22:56181] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/49-10715-17258B95 for ; Tue, 12 Sep 2017 17:32:34 -0400 Received: from [192.168.2.106] ([79.243.117.113]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LyR1G-1dOp592S2Q-015ptN; Tue, 12 Sep 2017 23:32:29 +0200 To: Levi Morrison , =?UTF-8?Q?Fran=c3=a7ois_Laupretre?= Cc: "internals@lists.php.net" References: <6601584d-c76d-4ed7-b4d6-b95e1b401cae@tekwire.net> Message-ID: Date: Tue, 12 Sep 2017 23:32:33 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:L/BtREb0zBrazS4VYDnf2Rh3UzYVlKw8K+TgjLcOcDluUnR6/td wCsLolDY0XfYUyqtBX0Vv5ii7w62hH6gvX3WUkt0vuBuTHIDucZRXFkrQhdKnSKOhEZwJbx kk+fj4JKdscV/y+ZWtGzrLjYNfBlW3BgzVD/7PF74FXBA/DL8qmsPot0BXAqRBcPcowXaZx YKJ2tJY8F6LED/RmHykXw== X-UI-Out-Filterresults: notjunk:1;V01:K0:EoscKmCODEg=:JYm77XKo2W2UPwlGGHbMoe scnEea+c6Y8Ooh1lswWhzU5jzjMpaqa1daKaPW3pp5Gpc4w+VCYfQ7VD3csZcpYotDXD+rcc5 IHmWDuWOpK+H37OIfJzVf9HwWfutmQ2+hx6443bxlzbwnXbIuVqjnyALUMUbM6PGBTDrlocaL 91Abf7SOj4nYm+WB/LilD3isRdG6v1arePJ60up3PHJL/1qzJDiZW8/Uqgq03A3Z6T5/hCP/p NChpOgw53yjx3DGuU/m3uxE6ihtwsoVrGP2jNH4jQgSPgtkqqRjdZhrU2clMzCfcHFyLzwV8O /tQmVqBe5sciPbYUS9vftcfMC7McPG6azJUKnzDUkPY4OY+b0mqJyJJmSrmRGnMjmHLYcyv57 lJ3tblcXLx5ALdi7i/h5HOnD3jYO/gr6xci8NpSZzvms4ZHjaK4GkT0btku0PPJ3gFDivvHpP lN5AklzDvFkkyc0HbmWqc03D/RlcrhvQef75yBMZkSCSvD3mmpDM+bVD/kcglejaLDMRIvto9 98Br9JRHX6r5NnrcTJuenfB9bt2zRVRow6crJiEJQr+r/rMg0w3WZERDCdPIkDI8Sgr/Wnp3o mGTddyaWmBq+lPgxTynUXWvidGT8eykR+dDQ5raueEKrqPqi43+kUcHBGGAefAue2AAvB9TJ8 F7VGl9np/HIALlHLvbytHI7ASLNsemWkHI3YTnEatp3pfDmTqkgO6hCLeXZkR3Zb4CMNIWLx6 Tg5gBi6uFCIwoLjY1afyKIG8Q6tVc+kuZhyhjps/t1W7WGwyx/qXvu9lmDFJUTLTbjRbnxHY0 YPi2kyEpBY7g5R7GeuxW4x96ErBprurWnAZWvDahZOGfyw+beg= Subject: Re: [PHP-DEV] Deprecate and remove case-insensitive constants? From: cmbecker69@gmx.de ("Christoph M. Becker") On 12.09.2017 at 16:52, Levi Morrison wrote: > On Tue, Sep 12, 2017 at 6:52 AM, François Laupretre > wrote: >> >> Le 12/09/2017 à 14:02, Christoph M. Becker a écrit : >> >>> Even if these issues could be resolved, I still think allowing both >>> case-sensitive and case-insensitive constant identifiers does more harm >>> than good, so either case-sensitive or case-insensitive constant >>> identifiers should be removed from the language. Since case-sensitive >>> constant identifiers are already the default, and HHVM doesn't even >>> support case-insensitive identifiers at all, I would suggest to remove >>> case-insensitive constant identifiers. >>> >>> This could be implemented by triggering E_DEPRECATED whenever the third >>> argument to define() is TRUE in PHP 7.3, and to remove this parameter >>> altogether in PHP 8. Most likely some further simplification in the >>> engine could be done then as well. > > […] However, if we change only the case > sensitivity of constants we gain little value for our BC break. I have not suggested to *change* the case sensivity of constants, but rather to settle on a common case – since `const` constants are always case-sensitive, it appears that this should be so for define'd constants. This would make code as the following to work as expected: a.php b.php true echo FOO; // => bar - WFT? ?> And it obviously would fix a bug. IMHO, that is sufficient gain for a presumably moderate BC break. Please note, that I do not want to pursue a discussion regarding changing all constants to be case-sensitive or all functions and class names to be case-insensitive. Of course, it is fine to discuss it, but it is clearly out of scope for what I'm trying to improve (in my opinion) here, which is more in the "a bird in the hand is worth two in the bush" corner. If it will be decided that all constant identifiers should be case-insensitive, I'd be fine with it (not happy, though). Probably, I should reword the RFC to reflect that it is actually about deprecation and removal of the third parameter of define() (plus preventing any extension to register constants which do not conform to the "default" casing). In short: don't have two kinds of constants wrt. spelling (true, false, null are not covered, since they are special anyway and could be promoted to keywords). -- Christoph M. Becker -- Christoph