Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109698 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 37401 invoked from network); 17 Apr 2020 20:16:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Apr 2020 20:16:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3AB4B18055D for ; Fri, 17 Apr 2020 11:46:32 -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 NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12olkn2010.outbound.protection.outlook.com [40.92.23.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 ; Fri, 17 Apr 2020 11:46:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S+xTsvAg910HjbUM8noqwcMt2oApkefexoT6nWOOc9rfiDhSWQrzNizL0Wqtqga++Odix+9xBKeCZ6Fkf3Rx7U3C91RxJUzUdXzpFSdkKjxLzs7DR+ZU5VDR1XwzqXbZhPFJDgSgiuaIqNTlLFC7+caVIl/dJKYHhPJ1zvHe7o9ktm2Rr96qDEm9xn9IBDzzDWstXUA50OAKw029cx6xu1Yh4ZVCfcQlOEp3g5y2gOqx+sR+1ewUfqwSmDcTsbPrCup8pAVVIJSRn18VtacEy6dS+tWjFxuApd/YZqILilX5BE5rSH1CkhGXC+9bX7Q7ZO9HiayyY9CfSqVvyTMoTQ== 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=qlaPYaK4mz5+l7dMc4dalhkRITjNun3Awkd2UaSJmAc=; b=mlcQtJvkk8EvMWS6CsPJCkZ6U8r1kELGrhwWjOLE1PKkRBtoeFPGkMnr9+C8otup4NsaI2+mgLzSvqWAqrUpNgs60Zirv6WVH10BGvxk0pPu0EFcaDw2ZOhXb3ElfqJrUFJ1OB3z2f459MFPt/BrSuZmbUJBoWuL98KX8YSZBEmhs5TxprjUri477wGXov/cqFN0yEz/RJOOlXe7o0UAvSS7xvoQCpOFh69Hln7nuSMvWRbrK9ssA3bAKGM2mrwMaTdWQ83CU+SbtqhimAvTPMwcjN7nbQT3C3erZA+pE5OgzI6vBoZs3mk7DpSk0kfD57adRPEPGx+rO10gngTgjA== 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=qlaPYaK4mz5+l7dMc4dalhkRITjNun3Awkd2UaSJmAc=; b=p60l3PDOcGXaNHvNuxr1JAzb6yNU4zeHOwDozgIyF2AOY9otGyJKqXWS+EzsZMYIbuREgbNGxEZupgtbevY6/qHbCPgH3fpyFadz1kn8XahpBVERJFng+/mnJS1uhV/bFeJ4Ixf++LIYKzMJQwrvBprok66pD3MVbKE47L9OW2tkV5sczZhwdfgvjDrgXQGCHNwBi6Czg/oxLWSxW8t7pdfEpu/5rmlu9KESLs/yKUVzAtEHq0GXdauIiYBnRO9FqxVLYAmxPgUPGTwoojYJlB7j+FKNJyd12jYuVWXEAnmqmW/R+uAjytPG7V00G3sQ4Eb52haR+wUi7zocsU/0Gw== Received: from MW2NAM12FT008.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc65::46) by MW2NAM12HT011.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc65::280) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.12; Fri, 17 Apr 2020 18:46:27 +0000 Received: from BYAPR05MB6535.namprd05.prod.outlook.com (2a01:111:e400:fc65::53) by MW2NAM12FT008.mail.protection.outlook.com (2a01:111:e400:fc65::75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.12 via Frontend Transport; Fri, 17 Apr 2020 18:46:27 +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 18:46:27 +0000 To: Benjamin Eberlei CC: PHP Internals Thread-Topic: [PHP-DEV] Re: [RFC] Attributes v2 Thread-Index: AQHWFKX7h7lS/adMzU6pjZVUKKg53ah9ej1DgAAb7ACAAAuKCA== Date: Fri, 17 Apr 2020 18:46:27 +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:C92069B51C32F1B9C419E1D57A2B811CB64F251247AD268DA7A93587A7490EFE;UpperCasedChecksum:C012E22204257789773A7DB642282EA701F1942793A5E83D075BB0021B9A983F;SizeAsReceived:7181;Count:46 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [gY11Glh0A8m17+YXhnYGJ2gNhj0Du2Lq] x-ms-publictraffictype: Email x-incomingheadercount: 46 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 81ee9532-54af-4c19-a03d-08d7e2ffa32f x-ms-traffictypediagnostic: MW2NAM12HT011: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: tGmjQ60yIo4QOSni8fCObVail1NJzkeHgGmuzVzp7Qwo5eJQrAdtFgglJ1RWd5FIYz5Sy/+TsTFlrqjLUS3pzr/Kg+dKGKwrk28QqsVFSUn/TGYPAVrxxgk6KBon1HAM9u6eDSPeMM/mIxoq9bUiIkcNRKAbX5S4OUOWyRKf7U//lmuwXklSKo340+FVbBCYC2e8Q2G9Raz9uoO0BaNKOTF9z8PJemS+Tc8K448P1sTWlVZ8LVnqvhHaWJjB+UUm 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: BcmyzLHkYCJsdPMIk542AQ0xTM5VduTt/V9l6NnBGeKIJSHwDTSHmiPo5E+sxzCvZ6xIVYaxIJqMeQkjN3NiDZTwm5wJPFDOa50TEFVc5GcvswusLdLvS9cSBKuVi/AzGOmPhoAgzmaQiWQS/9QZ9w== 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: 81ee9532-54af-4c19-a03d-08d7e2ffa32f X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Apr 2020 18:46:27.7980 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2NAM12HT011 Subject: Re: [PHP-DEV] Re: [RFC] Attributes v2 From: theodorejb@outlook.com (Theodore Brown) On Fri, Apr 17, 2020 at 12:43 PM Benjamin Eberlei wro= te:=0A= =0A= > On Fri, Apr 17, 2020 at 6:11 PM Theodore Brown w= rote:=0A= > =0A= > > Can you provide an example of an attribute name containing whitespace= =0A= > > that would be allowed with the shift left/right tokens but not with the= =0A= > > attribute token?=0A= > =0A= > This is about [whitespace] between token and attribute name, so `@:Foo`= =0A= > is allowed but `@: Foo` is not. Whereas with the hugging As, `<>`=0A= > and `<< Foo >>` is allowed.=0A= =0A= Ah, that makes a lot more sense. Thanks for the clarification. I guess=0A= allowing whitespace could also be considered a downside, since it will=0A= lead to style guide wars about which spacing convention to use.=0A= =0A= > This is a personal assumption here, but I would assume 95% of developers= =0A= > have never used >> or << before or for a long time and maybe 80% don't=0A= > even know what bit shift means and how it works. I would think nobody=0A= > needs this in attributes.=0A= =0A= Even if bit shifts are rarely used, the fact that such syntax is valid=0A= means there's a higher cognitive load when reading attributes to=0A= understand whether a shift token is part of a parameter value or=0A= delineating the start/end of an attribute declaration.=0A= =0A= Quick, does this function have two attributes with one parameter each,=0A= or one attribute with two parameters?=0A= =0A= ```php=0A= <><>=0A= function foo() {}=0A= ```=0A= =0A= How about this one?=0A= =0A= ```php=0A= const Foo =3D 2;=0A= =0A= <>Foo, (4 + 5) * 2)>>=0A= function foo() {}=0A= ```=0A= =0A= Even if the syntax is technically unambiguous, reusing shift tokens as=0A= attribute delineators results in symbol-heavy code which is harder to=0A= quickly and correctly understand.=0A= =0A= FWIW Hack is apparently moving away from the shift token attribute=0A= syntax to one using `@` (see https://github.com/facebook/hhvm/commit/3983bd= 2ca6b252a93d98f2bb2d7e8e89f6f004d1);=0A= =0A= Sincerely,=0A= Theodore=0A=