Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100538 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96380 invoked from network); 12 Sep 2017 12:53:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Sep 2017 12:53:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.220 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.220 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.220] ([81.169.146.220:35355] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8E/82-10715-5E8D7B95 for ; Tue, 12 Sep 2017 08:53:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1505220834; s=domk; d=kelunik.com; h=Content-Type:Cc:To:Subject:Date:From:References:In-Reply-To: MIME-Version; bh=hrD6iub26iC3kyyAe0ld6hrAzAdjt5SzusH/4pk+Kfw=; b=Tyn6T9Gs5kTew+VFWKrLGWSIS5lSOmAkVSDUc3Q+Z7okdMUteG800TyETIqMecZ/kz 4YtEA+7smCnwhdhsvZfSaV2NrAkcbGtd3N22kOYSjfluEnZht4ap8A3A/ka/ngwaUsRm gr7i/Uc7JqWj2a3y8A4w4Ri3v2QcQ2wwk5IyM= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLDup6E67mzuYROBqD/sIU= X-RZG-CLASS-ID: mo00 Received: by mail-yw0-f170.google.com with SMTP id q80so27938578ywg.2 for ; Tue, 12 Sep 2017 05:53:54 -0700 (PDT) X-Gm-Message-State: AHPjjUjxrEz+6GPjjadbMl950j2Q8DFlXsEWzOES+KLIRDVbzlYyZWZ3 URQII7KuaKiCEn9Soa6c0QP38unvig== X-Google-Smtp-Source: ADKCNb6GpL/tuFfrUS/aNVov+uEetdNxKJwICMZ7TzshfarqJAP1+hbiL/vMSz6C68OUdwkq67jiTyuLVU6Z0bbmvRo= X-Received: by 10.13.215.9 with SMTP id z9mr13449044ywd.440.1505220833751; Tue, 12 Sep 2017 05:53:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.224.146 with HTTP; Tue, 12 Sep 2017 05:53:53 -0700 (PDT) In-Reply-To: References: Date: Tue, 12 Sep 2017 14:53:53 +0200 X-Gmail-Original-Message-ID: Message-ID: To: "Christoph M. Becker" Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary="94eb2c05dbca1ab7fc0558fd89a5" Subject: Re: [PHP-DEV] Deprecate and remove case-insensitive constants? From: me@kelunik.com (Niklas Keller) --94eb2c05dbca1ab7fc0558fd89a5 Content-Type: text/plain; charset="UTF-8" 2017-09-12 14:02 GMT+02:00 Christoph M. Becker : > Hi everybody! > > 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? > +1 --94eb2c05dbca1ab7fc0558fd89a5--