Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109695 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 14570 invoked from network); 17 Apr 2020 17:41:07 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Apr 2020 17:41:07 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 799F21804F3 for ; Fri, 17 Apr 2020 09:11:34 -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 NAM04-CO1-obe.outbound.protection.outlook.com (mail-oln040092010084.outbound.protection.outlook.com [40.92.10.84]) (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 ; Fri, 17 Apr 2020 09:11:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ml6W3DEgY5dV6SKJeimEgv34SBM7vuHJxsI0dPUQgrmvl+49XfTmZg6BPycK8rMnMoOqwOPgH0F4KRT6FM0Iwiv+yh10PEj8JP2nPphGFzIoFt9FkzCy8YII7kScfDPXzm8hCI4PKJlmJ3PmPvCVa98Tuc20eFDohNIHeMNRlTFBOrfQETqoMncRAacwXtUatj3Z2dk0drIe3O0ukejIbZkaEzPYvp8Sq5RysznlrZPjn2dJuQVPzm8YvODAR4Gi+WVMvC3JrmyHQY5C4K/fR2BqP6LDRbKZbaFX/rGNE+Qxjk0rimAu9EYPC6Y/qsGCQEonrNbORLAkYX1yz8vlPA== 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=Bbd9v5DGuRkfomrfTt0DKOwLf5j9KCG/vDaBSQHBXWE=; b=S/vITDUYhQlc/YYDfo4FsGDhorzfhiLwvd4XRxZJ4nAVy6HPhsTV0HXFG8is+6M793C1n+F/TyZjrwiHvM70/K1Inzj7PsKhAYOayAmIfmL5f818M24wsscQA7n380Oz5aHgaNn3E1p7FjvEh/yRd0DGbA4t0CnhBA6sf8pN6RJu3FqJl4IF0bFmXrHwMCdGJbzfPliHVLmkDwHZ0oSP5Tai1C2CiOi/A7Vo8Q6fcLGjkGQ7OEPhA39tVXO+Pmzdtm4xo0GNazrwNW52fxJWOYeG6fxzKFp3U0+u+QAhY1d3oJmPWj1EV6tg0kl8pfmQdo4nr2NuQcsJ4Ewekm752Q== 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=Bbd9v5DGuRkfomrfTt0DKOwLf5j9KCG/vDaBSQHBXWE=; b=hb4gQVYfF3OB6mc6QixKgjdHEC/CEtRCxwvqaSgbgjdWF1uJ6xg7UKXPkeuJ6LHk3XrGNhkyySYRQPHSDUYqxcxPJTmo8jMs+zitejVk5SemOCA3D/yIOoLMyVssMlql5B605KXHq4cd1je8QCFTRr1Tq3Rh8+5/ObCuRwkBK/Hi8blt9aCZ9/x/VFbPMzSc+cDMF3rf6S/nsjXxnj/xA0cG7KrdkdmhBfSpAXlCsghR6B6Fx5xbI7uoPvN2OeDbEf4/WWV12a8IF+P/1Tg6VbFyq24lhWLeONCxsC28jXWLcxqS/kA0L3pbqKFAo+44g8oY1CMLvSoNiyjrJo3hJg== Received: from CO1NAM04FT043.eop-NAM04.prod.protection.outlook.com (10.152.90.56) by CO1NAM04HT233.eop-NAM04.prod.protection.outlook.com (10.152.91.177) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.25; Fri, 17 Apr 2020 16:11:28 +0000 Received: from BYAPR05MB6535.namprd05.prod.outlook.com (2a01:111:e400:7e4d::4d) by CO1NAM04FT043.mail.protection.outlook.com (2a01:111:e400:7e4d::429) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.25 via Frontend Transport; Fri, 17 Apr 2020 16:11:28 +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.007; Fri, 17 Apr 2020 16:11:28 +0000 To: Benjamin Eberlei , PHP Internals Thread-Topic: [PHP-DEV] Re: [RFC] Attributes v2 Thread-Index: AQHWFKX7h7lS/adMzU6pjZVUKKg53ah9ej1D Date: Fri, 17 Apr 2020 16:11:28 +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:075928965CEF6362C331E924F801CAAFC9EB06A224DFF9C1A0856DD3EC76AB25;UpperCasedChecksum:BBC73D003BB1ABDAB701A297C79AD5190FB84E116C4AE56722125572655C7DB8;SizeAsReceived:7010;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [4IByFltFDuC0w7+Kj4Coy3KuB1OI/DYP] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: de492865-413e-47a3-8157-08d7e2e9fc8b x-ms-traffictypediagnostic: CO1NAM04HT233: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kI/9IJUCjklAcFLfWPePD4Nus8jhvP8NF0KPUnK6FiUtWX9quOSHexd18+g6mJsf/02nmn4UqCeyDbdjfo+LFgElBrVbhX2wK8/hAvpfJjUS81TX43P0iEF386W/uiqUF71LvUgw4DRgZGKyhOTqQziP1zYhAXnyTcqnLrtWAW7MeV+8CXM6tP3zIqZOhTIU2Htbjdoekm5OAU0VNEfE4kXuZ/jkOq0hwYqO/RH4ypnPC38RiOf3M1MhnbIbZv51 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: fF7a0mMRRraKWMmuVTTx2L9f/q9uMcEe4Q1WCXFvW1oyYpISQVfMebZCvL+LYBQG/FaE5N/Wpn03tDUcJx/l37Z2eCxWV6tN5LNCsAhlRnpSUxV/WzJZneAyZezjGOKFkhhfVFYhPkPMUMGby7Makw== 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: de492865-413e-47a3-8157-08d7e2e9fc8b X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Apr 2020 16:11:28.7453 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1NAM04HT233 Subject: Re: [PHP-DEV] Re: [RFC] Attributes v2 From: theodorejb@outlook.com (Theodore Brown) On Fri, Apr 17, 2020 at 5:49 AM Benjamin Eberlei wrot= e:=0A= =0A= > As there has only been minimal new discussion after the last changes to t= he=0A= > RFC I wanted to give a heads up that I will open the vote on Monday=0A= > afternoon.=0A= > =0A= > If you have further remarks or questions about the RFC, please let me kno= w.=0A= > =0A= > On Mon, Mar 9, 2020 at 3:42 PM Benjamin Eberlei wro= te:=0A= > =0A= > > Hi all,=0A= > >=0A= > > I want to resurrect Dmitrys Attributes RFC that was rejected for 7.1 in= =0A= > > 2016 with a few changes, incorporating feedback from the mailing list b= ack=0A= > > then and from talking to previous no voters.=0A= > >=0A= > > The RFC is at https://wiki.php.net/rfc/attributes_v2=0A= =0A= Hi Benjamin,=0A= =0A= Thanks for working on this RFC. I have a couple questions and=0A= thoughts about the proposed syntax options.=0A= =0A= First, the RFC says that the alternate T_ATTRIBUTE `@:` token has the=0A= downside "that it does not permit whitespace in attribute names to=0A= allow detecting the ending of the declaration." Can you provide an=0A= example of an attribute name containing whitespace that would be allowed=0A= with the shift left/right tokens but not with the attribute token?=0A= =0A= The RFC says that "Semantically the attribute declaration should be=0A= read as instantiating a class with the attribute name and passing=0A= arguments to the constructor." But class names can't contain spaces,=0A= so how is it a downside for attribute names to not permit them either?=0A= It seems like it would be a massive footgun to allow attribute names=0A= that *can't* resolve to a class name, since there would be no way to=0A= migrate them to a declared attribute class without a BC break. For this=0A= reason, regardless of the final syntax choice I think whitespace should=0A= not be permitted in attribute names.=0A= =0A= Secondly, given that attribute arguments are evaluated as constant=0A= expressions, it's far easier for me to read the T_ATTRIBUTE `@:` syntax=0A= at a glance than the syntax reusing shift left/right tokens. With the=0A= latter my eyes tend to confuse shift left/right tokens in a constant=0A= expression with the open/close token of an attribute (especially since=0A= the syntax using bit shift tokens allows multiple attribute declarations=0A= on the same line).=0A= =0A= Consider this example using the shift left/right token syntax:=0A= =0A= ```php=0A= <> 1, 4 << 1)>><> 1, 4 << 1)>>=0A= function foo() {}=0A= ```=0A= =0A= To me the same thing using the T_ATTRIBUTE syntax is far more readable:=0A= =0A= ```php=0A= @:BitShiftExample(4 >> 1, 4 << 1)=0A= @:OtherAttribute(4 >> 1, 4 << 1)=0A= function foo() {}=0A= ```=0A= =0A= Best regards,=0A= Theodore=0A=