Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102573 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86038 invoked from network); 4 Jul 2018 14:12:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jul 2018 14:12:17 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.43 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.214.43 mail-it0-f43.google.com Received: from [209.85.214.43] ([209.85.214.43:36981] helo=mail-it0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A0/F2-55607-1C5DC3B5 for ; Wed, 04 Jul 2018 10:12:17 -0400 Received: by mail-it0-f43.google.com with SMTP id p17-v6so8224543itc.2 for ; Wed, 04 Jul 2018 07:12:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=3ky4KVau1keS98QjaVSoPNXJrHQSQComLlNRcu1XHfw=; b=coZI37XXD4Ghel6YsZRfqdl1xXFKUAX8XoHTE2+wEVYP1wTOg+D7hm3lz04b+VB6ZS j+hGYkDu2oBsr5IOPQOAwYNCXCrawmIGdx7ab9/1x6hv6ugyRbG45xgQQMcrVjA6U2Bd kgPrMKeXAUqVV2XPwMXxMNIU6WpTt46Vly8ZWvw+n7aLkxJF8xCdHVzRNQ07wiNsbO+E jngsDbGO8vbCBFflBJo1Yi792/z1ox8ycZbTEfNtrg5Ad0PqQvtrVaZxVFY4+KasuFhx aL4lwndaodrwbKy9ZG2dEOt/+UnNjbOo+yDHl+a6+pw6DW3ptUzA0vlqWAZGMBYJiqDv tClQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=3ky4KVau1keS98QjaVSoPNXJrHQSQComLlNRcu1XHfw=; b=SXo+pz5KbygxvUr4UcQuJ69dAYlnPp0XRXP1aBxdBSgvFKfrDDnr64mX2qQTaY08Fc BFsgbRGt5g8pIb7/r1sXQU6ZsNVsmJZT0DvOceWOOMeCwwJ4JQao4W1iWxsV5Qs4G9/C duA8vWwXCEwzawgyPNwthTg6EgkP/i80lQ2/FS7abDvCOg6ksy3yiwJFz5lbvtJfKeeo lx/xBqUGFAM8uCCBJSZiCDHuQY6D73iPPRaOj2ZzfIVKjvVoupcWaXSvnuAgjMLbaUTQ Yu76SMseKcXH9me0/DErqjpKR6vYBxU4+YgaHAY5B2eaG1Zy1nK6/AGgDUxmio2NfwtM 1iag== X-Gm-Message-State: APt69E1BDOwaIBUelA0aUtgX+egHviEGBFBFawXbXLj0t24wTcvvz7na XmtH+/cJqLSF8eNuHH6jfpvMf2dZ3lIAd5/hryI= X-Google-Smtp-Source: AAOMgpd70RHLK4Ariuv4Msjo3D4ui9uPzQR9cTtsM5bZW5rjyCwJjRQsKXQo4+ewq+ZfGTM0ZD210RSlu1okSQ8I8TQ= X-Received: by 2002:a24:3c41:: with SMTP id m62-v6mr1824562ita.63.1530713534376; Wed, 04 Jul 2018 07:12:14 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:148a:0:0:0:0:0 with HTTP; Wed, 4 Jul 2018 07:12:13 -0700 (PDT) In-Reply-To: <4b90f1d7-62ce-337c-42d7-d77743a979df@gmail.com> References: <4b90f1d7-62ce-337c-42d7-d77743a979df@gmail.com> Date: Wed, 4 Jul 2018 16:12:13 +0200 Message-ID: To: Stanislav Malyshev Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000782f3c05702d0490" Subject: Re: [PHP-DEV] [RFC] Deprecate and remove case-insensitive constants From: nikita.ppv@gmail.com (Nikita Popov) --000000000000782f3c05702d0490 Content-Type: text/plain; charset="UTF-8" On Mon, Jun 25, 2018 at 8:03 AM, Stanislav Malyshev wrote: > Hi! > > > https://wiki.php.net/rfc/case_insensitive_constant_deprecation > > > > This was already discussed some time ago on the list, though that > > discussion degenerated into unfortunate directions. I'd very much > > appreciate if we could keep discussions on making PHP fully > case-sensitive > > or fully case-insensitive outside of this thread. (Feel free to open a > new > > one though.) > > > > The main point I'd like to have feedback on is the handling of true, > false > > and null, as I'm not sure what the best approach regarding that is. > > I think the must is to keep true/false/null working in all cases. I > don't think messing with this would be acceptable due to amount of code > it'd break. > > Now, I think breaking constant("null") could be acceptable in PHP 8, if > necessary, as use case for this seems to be very narrow. However, I > wonder if we can't just special-case those three in constant() function > and write "for historical raisins, this is weird" and be done with it. > Not ideal, but practically might be good enough. > > Converting them to keywords should be fine - am I wrong to think the > impact would not be that big with new parser, as we now have less places > where keywords are banned? > > As for the rest, I think we should get rid of case-insensitive constants > (including defined by extensions) and all the weirdness that follows. > Deprecating them would be a good first step. > Regarding making true/false/null reserved keywords, the state is as follows: * true/false/null are already reserved class names, so they cannot be used as class names already (no BC break here). * Method and class constant names are not subject to reserved keyword restrictions (no BC break here). * Global constants (e.g. in namespaces) already check against true/false/null, though there are unintentional loopholes (no BC break here). * Function names can still use true/false/null right now. So basically the practical BC impact of making them reserved keywords would only be a) cannot be used via constant() anymore and b) can't declare global functions with these names. Given that making them reserved keywords is otherwise the cleanest solution, I think we should go with that. Are there any other opinions on this topic or the RFC in general? I'm a bit surprised that there are so little comments after the somewhat explosive discussion last time around. Nikita --000000000000782f3c05702d0490--