Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109717 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 99279 invoked from network); 20 Apr 2020 14:42:25 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Apr 2020 14:42:25 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A4D231804C7 for ; Mon, 20 Apr 2020 06:13:35 -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,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8075 40.64.0.0/10 X-Spam-Virus: No X-Envelope-From: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-oln040092003065.outbound.protection.outlook.com [40.92.3.65]) (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 ; Mon, 20 Apr 2020 06:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FZyF4xSuSCen1FiWkt4OLthd6/YUfo23fprJ4+BTa+euYvespzOolyviRM7zuPBmtAZJ46KJZ/9uYwQQh5x/FNunG5yHeUGwVCQ6rqS0h1mwkadV3LRr152pCOGEOOJNqJLGqnevZcOpIfdo0kR1pWPJ28db7I6fadhTeR6WFPVHXeRrpD0g8lLKlKuhr7itz1NIZiZjEVpW2zA6gnczDhAonFXMLNuCF9Wm5rXcNrpwzO1FfId4t958M262H6kiDKEO59IsS/Zmoi9l/v0iPiU/NuDx9ND7r6mr4FpkCcqCBqsQyOokvWp62G9NubJBQ+ZMVU7wr31yEoSQVX8S5g== 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=y8b4pBqZ0DsIar9gtxuxh0rts3hrJGoq6Kfg+R7qDvE=; b=Vtafx7bdQ52KiPwdSH70FXgTplCUl+wTR4PY8jGRVlvXn4oVr3xIYRZMxme3Y98Df/pRP25gJg/VgH1mXLLSwhWXVqyQiMCb4FRz8/Jc/0nmp1zAm98sDn8bKI43oU+nqPL5Av4IqFOUDqmx7evO/oJ94bHu/nE+xt1IElG7d/ZBKgeS9zkXXS5DXwfhKvu5PNQ0YBcJYkvlcB7ZdE/6/WWMG3UQBuR3X/T+EexIq+8qwa0No7pABQ2xg+zhfCszgk3nGWeZqstCL00iCWQjChvsE5BE2vTmOgObUYBD50u15XkiXvxw9uR/3LI6vB42l4Urzlt7sHf8/fpZHEG4rA== 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=y8b4pBqZ0DsIar9gtxuxh0rts3hrJGoq6Kfg+R7qDvE=; b=NKo2dRJ8ZUeeUc+C6he+818m5h7Ga+dJoX4XMlnRdX4667EeCxhJl8tO+rw4t1hBet3vf+PWdETM5qJjYR9sMssmFO6W+t5DLbbG8GJzWKKidR0ZDLJzUoOf/cFE/Bf7ew3zlWgofGFlAg5q/SdTG4La+OVabhMw5JSBZzcTLlcQbuaWwRNFXMQkH7fUg5WIKHMyucV8Nl1LhoMWy9Zz3dvaN2Ifp0ERpEPq2rj11ocU6Ne1dO1DiTqCyZyicjNUHjq/MCZ/0Um7ahjo803fmMjiwLzY2vpD6Pu/ov2qrBqPNJJRtN6+pIxnlp0JvsT3Z07HoI/EizAJXqurX0aC7Q== Received: from BL2NAM02FT055.eop-nam02.prod.protection.outlook.com (10.152.76.60) by BL2NAM02HT127.eop-nam02.prod.protection.outlook.com (10.152.77.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.25; Mon, 20 Apr 2020 13:13:33 +0000 Received: from BYAPR05MB6535.namprd05.prod.outlook.com (2a01:111:e400:7e46::50) by BL2NAM02FT055.mail.protection.outlook.com (2a01:111:e400:7e46::382) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.25 via Frontend Transport; Mon, 20 Apr 2020 13:13:33 +0000 Received: from BYAPR05MB6535.namprd05.prod.outlook.com ([fe80::70ae:fe95:f263:2974]) by BYAPR05MB6535.namprd05.prod.outlook.com ([fe80::70ae:fe95:f263:2974%2]) with mapi id 15.20.2937.012; Mon, 20 Apr 2020 13:13:32 +0000 To: Benjamin Eberlei , PHP Internals Thread-Topic: [PHP-DEV] [VOTE] Attributes v2 RFC Vote is open Thread-Index: AQHWFvSr4I+5cGaWq0Gqyri4i3P3oaiB+4V0 Date: Mon, 20 Apr 2020 13:13:32 +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:88FC7238B735919EC977701E7C8A58E0C16BB60C3068192E00D2BC2FB035FDA2;UpperCasedChecksum:5C43A2F940E14B942FBA174B0A469782F310E0A511DDF7DF6FE5BB79E7D167DE;SizeAsReceived:6960;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [CNAGnsN7EHO59y8U4goeViwMRU0ALTYj] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: dacbcde8-c550-4aa8-465c-08d7e52ca060 x-ms-traffictypediagnostic: BL2NAM02HT127: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mIaBFYnIb3iUiOkN80HWGJ3tx0oa7Hk6vclwXt1HRUPn7be8FHVkklRXb5c558Ql3Qc7NzBlGf6IXQ92T/zqbPdk+liRwBorAMybHTOa/H9yUT0owDY3YKMJ8QhwY0momtzLGRULLTj4H1KVqqfuIAsP3MkfTNOBmhRUSVYkQZmVE7ad2CpmFii5yVZ++sp1UCXKwwsPHvrrsOqkEcF2w+djazwtccx6BHSr8bXj3icWhrqsLFIyTB+k16L9ypek 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: cwX09fA4MPMusFgoUZBwYdCB8EY6wEtlM644Tw7sy0EbiiQtFaq7eYcTo8+6mkIgiQqFWvy1/DRU9Pdp8dl64dlJ966QrkS6OBeBX3ISygJ1i6xJ08qODbiCYnxQKsFu05rR6+GQO//BnDyHZfEpWQ== 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-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: dacbcde8-c550-4aa8-465c-08d7e52ca060 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2020 13:13:32.7840 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT127 Subject: Re: [PHP-DEV] [VOTE] Attributes v2 RFC Vote is open From: theodorejb@outlook.com (Theodore Brown) On Mon, Apr 20, 2020 at 4:18 AM Benjamin Eberlei wrot= e:=0A= =0A= > I have opened the vote on the Attributes v2 RFC. The voting will be=0A= > open until two weeks from now, May 4th 2020, noon UTC.=0A= >=0A= > RFC: https://wiki.php.net/rfc/attributes_v2=0A= =0A= It's unfortunate that the RFC doesn't more fully enumerate the=0A= advantages/disadvantages of the proposed syntax options.=0A= =0A= It only points out that the T_ATTRIBUTE `@:` syntax is shorter and=0A= more familiar, but claims that it has the downside of not permitting=0A= whitespace in attribute names (it's not clear this is really an=0A= advantage - just an opportunity for arguments about code style).=0A= =0A= But if you look at the pull request for the `@:` syntax [1], there is=0A= a much more complete comparison. For example, the `<<>>` syntax is more=0A= verbose, unfamiliar to most people, and even Hack seems to be moving=0A= away from it. Furthermore, because it reuses existing tokens with a=0A= different meaning, it results in expressions that can be very difficult=0A= to read. For example:=0A= =0A= ```php=0A= const Baz =3D 2;=0A= =0A= <><>=0A= <>Baz, (4 + 5) * 2)>>=0A= function foo() {}=0A= ```=0A= =0A= If PHP gets generics in the future (hopefully it does), the syntax will=0A= likely get even more confusing (if not a lot of PHP developers use shift=0A= tokens, certainly a lot more will use generics).=0A= =0A= The `@:` syntax makes it much more obvious where separate attributes=0A= are being used vs. constant expressions containing a shift token:=0A= =0A= @:FooAttribute(2 * 3 + 3)=0A= @:Bar(4 + 5 * 2)=0A= @:BarAttribute(2 * (3 + 3)>>Baz, (4 + 5) * 2)=0A= function foo() {}=0A= ```=0A= =0A= In addition, the `@:` syntax is less verbose, and much closer to the=0A= attribute syntax developers are familiar with using in PHPDoc comments,=0A= as well as the syntax with precedence in other languages such as Java=0A= and Python.=0A= =0A= The syntax choice is very important, the language will be stuck with=0A= it for a very long time!=0A= =0A= Best regards,=0A= Theodore=0A= =0A= [1]: https://github.com/kooldev/php-src/pull/2=0A=