Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100686 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74418 invoked from network); 16 Sep 2017 21:23:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Sep 2017 21:23:48 -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.21 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.17.21 mout.gmx.net Received: from [212.227.17.21] ([212.227.17.21:58624] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0A/B7-19300-1669DB95 for ; Sat, 16 Sep 2017 17:23:46 -0400 Received: from [192.168.2.106] ([79.243.117.113]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LrevR-1dPKSG10vd-013L69 for ; Sat, 16 Sep 2017 23:23:41 +0200 To: "internals@lists.php.net" References: Message-ID: Date: Sat, 16 Sep 2017 23:23:44 +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:ZhUbvQlK/SVC2z+TSlUJRmU2pfAx8O8UzKNfoU5vK2aNXsp03eP kEWvlD0vCwf5wFG3xFyav/nzbQdLaqM2ggzo/aTFi1nLLy8Pi4RdFwvJN8TgAUuC9MmqxJQ Brjf+REj+ynPkylNC0oPysPgUM7WYe0h8yawaBpVKCAd5RfRPghoL4E4/XgKnyahFwQMZwC fNcMRbZH209/O71jBOnZw== X-UI-Out-Filterresults: notjunk:1;V01:K0:Gvj6kAJKTbo=:DPmlBO8Exr/4JKMmqhg8ut PPC8I1me2DRkf29pp35hgbc9iZnJPlV/OsGrFjbVgic/4yitf68JiJodzkZHjjNkeg0P2Bgte axNRnvYk0SMd6yUMCEZ94dB3qXiPKWJUuu9z04R8GiY0BtL8EUxZWgOGFCrRdudx5kuyDTW5M f3G1VlbO1wc848RRQdNEhzfA67f3GHJirRG1Xpc5JuKlSstTGQPrHHm/24tvTkAhmyIgJFv0I oFrc7izUvYu8oJogwuyYh8tRKHJh6AA1QrEpMkrOfUV2KvqWXOKATMRR+l2xqB/h2E1PcpIbg D9ohtvIs4owaD5ug039yjVFDBKUEk8gtldzcHWBc0y+sR/VTpUZetBF1anKHYcVVepJWuhVJU vx3frhE6OjlqBZkntmjhkJnbIb4GLQGoY6pMN7aJHKxHsUm1/oe8Trwu2OkY9mqWCNPQ/UHo/ +ezEHYpvRvIK+QxvdFWzelH7NVnxOH7cNZ0KO+avpTfVl7n/uRjb2aQSnulKqB3U0mTGsjWMk 1KQtEaPHRuN3Nfz+pNIs29kFPRNYp8bw072oEV8tt8azbj/83sNnfbziz2iRSEoqhNOarqGIe J7Tkqg31gqRA/1oVaUPCW8F5EjUUSNnjIh5IFHgtEkCIa+y3M8+aaDu8iwzogaEpvC82JKkfQ BRJEv3KUoiwHZz73gcF2YIT8PhqT+nQTHMM8r2J4R/qaBwEYZjSp1eJ1aySfUYXREh9OuyZsw PuBi2R4/qGfHnCgz+wfJS88EsidTZMNo+A1aORgj3V3wHo4kTfNrm10Rf29YAX0b2YsnpLEZU NghSN116ad0QrCWRWtutoDDl7s24BUDVIaBqVp1kc4sy8wKx90= Subject: Re: Deprecate and remove case-insensitive constants? From: cmbecker69@gmx.de ("Christoph M. Becker") On 12.09.2017 at 14:02, Christoph M. Becker wrote: > Usually constant identifiers are treated case-sensitive in PHP. This is > always the case for constants defined via a `const` declaration. > However, define() allows to pass TRUE as third argument to define a > case-insensitive constant. This feature appears to potentially result > in confusion, and also causes bugs as shown in > . See an example created by Nikita to see > some probably unexpected behavior: . > > 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. > > Thoughts? Thanks to everybody for their comments on this topic! Frankly, I'm rather surprised about the large amount of objections – I just hadn't expected that. Now I'm pretty sure that a respective change wouldn't get broad consensus, and in my opinion broad consensus is of utmost importance regarding any change to php-src. Therefore I will not pursue the RFC. :) Sorry for the noise, if you regard this discussion as such. I, however, found it insightful, and learned a lot about case-insensitive constants, and I believe these lessions to be useful at least for me. So, thanks again! -- Christoph M. Becker