Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110710 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 2537 invoked from network); 23 Jun 2020 18:58:08 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Jun 2020 18:58:08 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 65231180552 for ; Tue, 23 Jun 2020 10:45:22 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 23 Jun 2020 10:45:21 -0700 (PDT) Received: by mail-ej1-f43.google.com with SMTP id w16so22499853ejj.5 for ; Tue, 23 Jun 2020 10:45:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=H6u/cCyfIxHWm8b1bWf2OTqdFCysZMCHSNr+zlAkuzc=; b=dw050O4kESgP/npPmAANnnev8xW1K3TAXJ1ip+ziobaUcBUL/6RCEFM1C+Ez2cIo8H uu9SvHxCni6dAkrqCI/Z7I+m9VjGjDOVzzUxdLkoLDAJjg2E6jvyzSOSkwF2ewir6JIk uVtxgliQvX79Ht/caMvgOsMeoioud9LMezmuqTEZ10+oKxfKjR2W4LdeIZJkaFTGrsyp 7DMviLFeuZVEJkawndV8bJ0BuZ50ez8XvcGfREEJE5KOq2L/BbrHpAtOos53vIjXs49t iRWZ1TK7fIwtbp1fJrIba57AckYQN+BI6KIh0WEVPc3VGmMW5mOevJhoY/XrWt1Kb1OU swiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=H6u/cCyfIxHWm8b1bWf2OTqdFCysZMCHSNr+zlAkuzc=; b=PbpRldSV8Hw6x0wXjhSlbhXPyIskRrTkY44Jpy31IMlom7Hex1lFlISlbditKi89vw THca17Znm30ILYkGuTSWFrJLJ7P9S0XyWbdKbTujobyIo4yka+F/XlTFT8U71DRs+Uu9 hzbXefGOxxA/p0HsL84Zeu4SKU5KlNCTzwjc6UndltlQSIZCHL7NOLPKImGDkCg83JdA E6exlF/zmn3h64mci/DXLzTLY3eOj1FIk6H20SnPVN7JOWQa3X7ZBWlMkADMesRxuZKQ UKTLYmnGYPm+/ZAgdfNFXSadCOyye6EXE1k+BbnqZqrTkJpPOC03Oe5q1yHgdHAG6wFO 5qZg== X-Gm-Message-State: AOAM533xGNc77xoT9t20e8Ls+vdjMxKCD2jkX1/5s4GUyCIDxhduHeF7 Zwf1coQwPC7Ruf3ng1niEZDEnlE+DT0= X-Google-Smtp-Source: ABdhPJz0AM6G7QgzvckJNEEd8bfaYiIwcQtkhJL799NBphNttiSYF38LWL70PFGmydVFCPgS0d1QGA== X-Received: by 2002:a17:906:19c7:: with SMTP id h7mr20901764ejd.403.1592934319811; Tue, 23 Jun 2020 10:45:19 -0700 (PDT) Received: from claude.fritz.box ([185.129.54.56]) by smtp.gmail.com with ESMTPSA id bo26sm15486873edb.67.2020.06.23.10.45.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jun 2020 10:45:18 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) In-Reply-To: Date: Tue, 23 Jun 2020 19:45:18 +0200 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: To: Nikita Popov X-Mailer: Apple Mail (2.3608.80.23.2.2) Subject: Re: [PHP-DEV] [RFC] Treat namespaced names as single token, relax reserved keyword restrictions From: claude.pache@gmail.com (Claude Pache) > Le 16 juin 2020 =C3=A0 10:52, Nikita Popov a = =C3=A9crit : >=20 > Hi internals, >=20 > Inspired by the recent discussion on reserved keyword reservation, I'd = like > to propose the following RFC: >=20 > https://wiki.php.net/rfc/namespaced_names_as_token >=20 > This RFC makes two related changes: Treat namespaced names as a single > token, which enables use of reserved keywords inside them. And remove > reserved keyword restrictions from various declarations. >=20 > The RFC comes with a small backwards compatibility break related to = names > that include whitespace, but will hopefully reduce the backwards > compatibility impact of future reserved keyword additions. >=20 > Regards, > Nikita In fact, for classes and namespaces, we can probably do better, namely = we can lift almost all keyword restriction, not only in definition and = declaration, but also in in use. Indeed, bare names of class (and trait, interface, etc) and namespace = can appear only in few, well-defined positions, where it cannot be = confused with a keyword, namely: * after a handful of keywords: `new yield`, `class yield`, `instanceof = yield`, `use yield`, `use foo as yield`, etc. * before a paamayim nekudotayim: `yield::$foo`, `yield::foo()`, = `yield::FOO`; * before a backslash: `yield\foo`. As far as I can see, the only keywords that can legally appear in those = positions (and therefore must remain unavailable) are: `namespace` = (because of namespace-relative names: `namespace\foo`), and `class` = (because of anonymous classes: `new class { }`. (As for functions and constants, I=E2=80=99m still thinking that it is = not a good idea to allow to define or import a symbol that cannot be = used. You will make the life of few library maintainers a little easier, = but you will make the life of many users a little harder.) =E2=80=94Claude