Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110820 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 49767 invoked from network); 2 Jul 2020 16:12:01 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Jul 2020 16:12:01 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9E6791804F2 for ; Thu, 2 Jul 2020 08:01:27 -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_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8075 40.80.0.0/12 X-Spam-Virus: No X-Envelope-From: Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-oln040092009010.outbound.protection.outlook.com [40.92.9.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 2 Jul 2020 08:01:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kDOEvaI3xKMLRy+YeyngA/vlUseOoSLLb6qfijz17w0AZSDSUI1mXHf/PjjD5QIcy9iNnH+2S+qFyK/KBdHwMOnmWkT/ukn0cfE0WI8+MAvdPzIVWmPnx4bLkCu6cbvBJlG+3NPqE1p6HjmzQOda6pxRVmQu56rKzedStJU8OdVzOuted9tLde/InR8a9bpbo2bBNphvNtxKlqEb7GQjQHyw1xttwRjxUQ9Tc5M+yHrYjcU7O+VVjj6lfAFemAM4v8dRlthck/Pl4GtBunoh3T+iWxunVw7yh8ePsG/FfVtOPf8F1PNglTj52T9thZdEzK7B+PWNOjQ4VAbJ7JQjnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EmN5lAxS2BETkuj+hs9ulUQ0DoochuDKqtegMYJWoaQ=; b=OuIZRVi5yRmly0GH74cqOpW5jAHCTpkFxBEyUAPsadsP0Myw1VnnIf/7xEunuRe2b64z791QNXjCLKBlsWeVkRwGRsXhALL5RQmoo/ggpmYSWpU82/dp4C5Lxre8U+r5Ok6hQ6nE2KMc+hvE9+PttyGPgAvWLrIERXDSvaSv8nszXtK0vlsuLQr9xx6q5u5xlm3fb8qddzZGa5oIaOeTq03yfWMoKK++lmPeVD/7aahgubP5LCcgVJKbIQgD8f2I7t8MyrmmidUTEJgXgMVeVC+opUqrBWm717v1tnHh3JidsUffJh/ebyDKYnQDl6DZRM/IBSDOThBjjE2+pkX6Zg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EmN5lAxS2BETkuj+hs9ulUQ0DoochuDKqtegMYJWoaQ=; b=eryIso0jxYFtrGFHLl1n4Se9xAbqSJNjSs74yynR+ixQ5O0U3Vl/Q9uideV8rQCg4RaXsVdDjI3Y6zy8yemgDcvOlB0bp824KlsGZ/cXRIEOmKxHAjIgnF/WP99BqTc702nW2dJELQYu17qrWPin/gESo9kw6f7vrZW/ApP4/ULDcXoNqFQQGwb8JTchGFyr/+4CPbxQtCdRpb6UsqZE2XyatwJLmsalNk9Mv2vyBzxAsxPT9GjHTzQhCXawqVgDNan2+Q/b2fnKZhQJEGUrkoBvlZAzCY+2ticZ4XNf10nGuA2wChrDYBttGjeI5jXC4bSpsD19uZFwyVQXrEiKXQ== Received: from SN1NAM04FT048.eop-NAM04.prod.protection.outlook.com (10.152.88.54) by SN1NAM04HT115.eop-NAM04.prod.protection.outlook.com (10.152.88.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20; Thu, 2 Jul 2020 15:01:25 +0000 Received: from BYAPR05MB6535.namprd05.prod.outlook.com (2a01:111:e400:7e4c::41) by SN1NAM04FT048.mail.protection.outlook.com (2a01:111:e400:7e4c::451) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20 via Frontend Transport; Thu, 2 Jul 2020 15:01:25 +0000 Received: from BYAPR05MB6535.namprd05.prod.outlook.com ([fe80::54e2:1eeb:fc5d:8c21]) by BYAPR05MB6535.namprd05.prod.outlook.com ([fe80::54e2:1eeb:fc5d:8c21%3]) with mapi id 15.20.3174.012; Thu, 2 Jul 2020 15:01:24 +0000 To: Nikita Popov CC: internals Thread-Topic: [PHP-DEV] Re: [RFC] [VOTE] Shorter Attribute Syntax Thread-Index: AQHWRQKQbvf9bxvtNUSOWe9X3tRkaKjzfK/pgADviwCAAAOGMw== Date: Thu, 2 Jul 2020 15:01:24 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:3C70948BE3C6742DDE384F4C0866D1D428BF2A43DD65B126A0A3949448FEF2A4;UpperCasedChecksum:B06B531C273D2D883FF5D04D8F7A6A82CF1F809E421E05DC8D23CB77F08724B1;SizeAsReceived:7096;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [qxfIr+SZboqiiIv4N9PlQdfSYuMhEMD4] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 51e213ab-ebc1-49ae-3995-08d81e98ca33 x-ms-traffictypediagnostic: SN1NAM04HT115: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GDd8s78dPdgz67ZPpwME1sBlMDPVTq4jh+JF7SHQRn08Ybbr0GLjxA3Zt+1X4XN6ehV1h4whHh+6xLf7QE4RvJSTidJZwc9hygKLtOc7BUBADyINKYejAWvNpveOKYN6XjGlriLU82M73jCnTuTspHZbpWZpdFboMIc6Aegblp6Ctp+BWmb5RyYkM17JqEjajsc++0+nRSsqKiyje6aaeLMDjhzQoiES+YKABWY2fAMHfR/lMF3SjCwwqQw8+4A2 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR05MB6535.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; x-ms-exchange-antispam-messagedata: Dp+nEUUsb/3qG36c0ydyjV7FRsrCYVO70Oj3vGbT1ryQ64ryQ9zZxTpsdpucAYsviR+F0G0+FWNsbbUNglheoBpghcDv9Gp/t1MxNyRgKudoNSJaluYWeKKkKjgPL4bubAK9XNSXH7hwYuvTjATk8g== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: SN1NAM04FT048.eop-NAM04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 51e213ab-ebc1-49ae-3995-08d81e98ca33 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2020 15:01:24.8492 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM04HT115 Subject: Re: [PHP-DEV] Re: [RFC] [VOTE] Shorter Attribute Syntax From: theodorejb@outlook.com (Theodore Brown) On Thu, July 2 2020 at 8:14 AM Nikita Popov wrote:= =0A= =0A= > On Thu, Jul 2, 2020 at 2:13 AM Theodore Brown wr= ote:=0A= > > On Wed, June 17, 2020 at 5:59 PM Theodore Brown wrote:=0A= > > =0A= > > > I've opened voting on the Shorter Attribute Syntax RFC:=0A= > > > https://wiki.php.net/rfc/shorter_attribute_syntax=0A= > > >=0A= > > > Since all RFCs require a primary vote with a 2/3 majority, there is= =0A= > > > a main vote to approve the secondary ranked-choice vote.=0A= > > >=0A= > > > For the ranked-choice poll, fill in your first through third syntax= =0A= > > > choices, making sure not to select the same syntax more than=0A= > > > once. You don't have to vote for all three options, but please=0A= > > > don't leave gaps.=0A= > > >=0A= > > > Voting will end in two weeks, on 2020-07-01.=0A= > > =0A= > > Hi internals,=0A= > > =0A= > > The Shorter Attribute Syntax RFC vote is now closed. The primary poll= =0A= > > for re-voting on attribute syntax was approved with 50 in favor and 8= =0A= > > opposed.=0A= > > =0A= > > For the secondary ranked-choice poll there are 61 valid ballots. Since= =0A= > > only one syntax can be elected, the quota is floor(61 / 2) + 1 =3D 31.= =0A= > > =0A= > > Note: one ballot wasn't counted since it selected the same syntax=0A= > > more than once. However, this does not change the vote outcome.=0A= > > =0A= > > In the first round the tally is as follows:=0A= > > =0A= > > @@: 34 votes =0A= > > #[]: 21 votes =0A= > > <<>>: 6 votes =0A= > > =0A= > > So @@ reaches the quota and has been elected as the final attribute=0A= > > syntax for PHP 8.=0A= > > =0A= > > Thank you to everyone who voted!=0A= >=0A= >=0A= > Hi Theodore,=0A= > =0A= > Unfortunately, the RFC failed to mention a small, but important detail:= =0A= > The @@ syntax is ambiguous, as pointed out by Martin Schr=F6der:=0A= >=0A= > function (@@X \ Y $param) { }=0A= > =0A= > Taking into account that PHP allows whitespace between namespace=0A= > separators, this can either be interpreted as an attribute "X\Y" on an=0A= > untyped parameter, or as an attribute "X" on a "\Y" typed parameter.=0A= > =0A= > The RFC implementation solves this by treating @@ and the following name= =0A= > as a single token that does not permit whitespace. As such, it will be=0A= > interpreted as "X" with an "\Y" typed parameter.=0A= > =0A= > Now, if this had been explicitly mentioned in the RFC, we could have made= =0A= > an explicit decision to accept this language inconsistency: To forbid=0A= > whitespace in namespaced names for attributes only, unlike all other=0A= > places in PHP accepting namespaced names. However, it was not mentioned= =0A= > in the RFC, and apart from the authors of the proposal, I don't think=0A= > anyone was aware of this ambiguity.=0A= >=0A= > Fortunately, there is still a way to resolve this issue in a consistent= =0A= > manner: Change the handling of namespaced names in PHP in general. This= =0A= > is exactly what is proposed in https://wiki.php.net/rfc/namespaced_names_= as_token.=0A= > If that proposal is accepted, then the ambiguity would disappear (and=0A= > the above example would become a parse error).=0A= > =0A= > My plan would be to change the https://wiki.php.net/rfc/namespaced_names_= as_token=0A= > proposal to either only deal with the handling of namespaced names=0A= > (i.e. as a single, whitespace-free token), or at least separate the=0A= > other reserved keyword related changes into a separate vote.=0A= > =0A= > If that proposal passes, then there should be no issue with adopting the= =0A= > @@ syntax for attributes (unless there are other problems I'm not aware= =0A= > of?) If it does not pass, then we'll have to discuss what we want to do= =0A= > here.=0A= =0A= Hi Nikita,=0A= =0A= Thanks for bringing this up. The original Attributes v2 RFC mentioned=0A= that the shorter @: syntax "does not permit whitespace in attribute=0A= names to allow detecting the ending of the declaration", but when I=0A= wrote the new RFC I didn't think to mention that this applies to @@=0A= as well (the implementation is almost exactly the same).=0A= =0A= It certainly could be considered inconsistent that whitespace is=0A= allowed in most namespaced names, but not attributes. On the other=0A= hand, since attributes are new syntax anyway it's arguably okay for=0A= them to have stricter semantics.=0A= =0A= But I agree that the ideal solution would be to change the handling of=0A= namespaced names in general, per your https://wiki.php.net/rfc/namespaced_n= ames_as_token=0A= RFC. This would also have the benefit of minimizing the impact of=0A= reserving new keywords.=0A= =0A= Best regards,=0A= Theodore=