Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111273 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51784 invoked from network); 30 Jul 2020 18:27:41 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Jul 2020 18:27:41 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C0F74180548 for ; Thu, 30 Jul 2020 10:24:09 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, 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-Virus: No X-Envelope-From: Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11olkn2047.outbound.protection.outlook.com [40.92.20.47]) (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, 30 Jul 2020 10:24:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ayLvjh+9VCzBIJAPpcsVnOSVSf+EKB+UJ3ipxsmPttdH1Is4hDOOovROxNXqZ8ras9nQYIL15DK/zUblcPuzpNxFAjY1/TN/XoHLFmIDWpzRjLJUa4Y1mEvcVR8YdPOc6SYFlkxhlmgMrfusMetOyhkVeR9rkTj/KrpS6qq49KxSnfKobpC2oSHnIrKGniyQQDQis7cXaXKX7q+beMfuMF+QHyXtuKRA9anaqBNpsmR2yCD1SqvGJ2/6YJUiLDFmCow7ivSUxgJBt/71u4b7dvdTsLEOhkLEOd0+X+c5F4RParZaNfqHR8BYvvWMVgctnF1oKSvi1AU8gWkC2MEQxg== 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=XmLnTYYOHeUrqTWsW3SxVtghAQXaZ8sVBRlqN3wx0bw=; b=GoJ4I2d5furHfaaFz65CROvo3lG9WYegz6VzImEKfMmLQoW9a1dw7eiIdz7S2+t0FiqtCvIgf5GMIYMNDca/6nctOjS0I89l0tOGqmk6RWmFolooSwp4n8MJexxRKADlkZc8yh7VZqnPoYf4pgsfT5FWaIbXb/ZSYDNmXawfeELPqyTVqTLraubPZEYEOq2nXR2zUKcLwg3K4fHrmPMCRvFJJ39w1hDOC0O3EzzdAipmiZrCshnHSzE1GI48NWJ94C9ysA0L+XTG77ZJA+JeKf7RXbz4D+yjaMg9OfqRKgbcMBUjND7jHW1/NVEb+fhQq1pfruRDsGnxDunYgJCQsw== 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=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XmLnTYYOHeUrqTWsW3SxVtghAQXaZ8sVBRlqN3wx0bw=; b=N80k4J6+d8Oq1SaTY1icavSyYD3RJH849dyMkGfj9cOfFLYkY4svPGi6I+7uIQA2lw9GnQXECFM5cv+gqrias/e+mKKp77KfdmWYiYlpqm5r+Yy5nbQSDZOXvJAL145YwEyubKTZSvmS/ihp6I9gQA83sgzwgaDcViWERE9nSdB97HA62YcOtXtUajoMu4EvMwWGtJYExnITSKWcPu5zJNPrcF6aECH3rLtXupa5pQRjRcTuXFLcT/pZD21Orr8TlGXXhihpOYYHSDkxdseU2S8ZStCZY6CkS34TBgKxPU6Sc7Y3W46tx4REDeYbhNV9QkrlpCDDOA1Jkxxiekg4Bw== Received: from BN8NAM11FT026.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::42) by BN8NAM11HT053.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.20; Thu, 30 Jul 2020 17:24:07 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:fc4b::53) by BN8NAM11FT026.mail.protection.outlook.com (2a01:111:e400:fc4b::307) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.17 via Frontend Transport; Thu, 30 Jul 2020 17:24:07 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::cc10:a3e2:1dcf:adc1]) by DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::cc10:a3e2:1dcf:adc1%6]) with mapi id 15.20.3239.020; Thu, 30 Jul 2020 17:24:07 +0000 To: Joe Ferguson , PHP Developers Mailing List Thread-Topic: [PHP-DEV] [RFC] [Discussion] Shorter Attribute Syntax Change Thread-Index: AQHWZO4I0QL2FiMxn0qlAoSLzTT8dakgFjaAgAAKYQCAAD8McQ== Date: Thu, 30 Jul 2020 17:24:07 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:D93147C92451978F5EA9E683C62E8652BE698616AB6631BFFD46812763D883AB;UpperCasedChecksum:5EFA48ACEC97775A0A914C59F2C99392F6BE96A76C5C111C4E1E86BCCDB2AADC;SizeAsReceived:7125;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [ogm7gxYB2pRHu1rpHyOKxeHQ9frlRgeN] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: e099f96f-f458-4126-f0a6-08d834ad5d60 x-ms-traffictypediagnostic: BN8NAM11HT053: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rRGFjcbVucBAW3E43AEq6o6lHzNC5jTR7qXxvGjENcLY8MRzLPm1wJYlThzIm7bqXYnIyZFIDo9JhurBGq2n4NjOv9s7W9Kxut4vkxQDtYaGW3YOCzdEltN0H54A6wLh14MLa4EsNUOPEV4jxcOS3jnh8wGSrPb+dNvikLsd9fMrI7aww3tpXcj4meVcfXzyBDkEX1Gb+CJInv83BHCpR8SxjyFS6aWotRO/cPh++DUcxmIcA8vl4Lmf7zgDhUFe x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR07MB6618.namprd07.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; x-ms-exchange-antispam-messagedata: 3+yqw8k5GmQ1js+Z9fP+A0K6OOZPw29TXXowYSOxWgELeujfssw65RaonaUC6jrpLM0QULwV4Jkq2EENNEq8LISX95Bz2lJHKZJltrEhc5gh8dFEdSDpd1QQXtfJHzsCZXR186YxfYedT5OJZW0KQA== 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: hotmail.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT026.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: e099f96f-f458-4126-f0a6-08d834ad5d60 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jul 2020 17:24:07.2906 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8NAM11HT053 Subject: Re: [PHP-DEV] [RFC] [Discussion] Shorter Attribute Syntax Change From: tysonandre775@hotmail.com (tyson andre) Hi Joe Ferguson,=0A= =0A= > Now that it seems the technical concerns around @@ have been resolved by= =0A= > another pending, passing, RFC, I'm still here wanting us to talk about th= e=0A= > impact of @@ on static analysis tools. Apparently, internals doesn't care= =0A= > about these projects. I care and I'm trying to help. I'm not trying to=0A= > revote until I get the vote I want. I'm just a dude that had some free ti= me=0A= > while on vacation when he saw a chance to contribute.=0A= =0A= 3 commonly used static analyzers (for type inference) are=0A= - PHPStan and Psalm, both of which use nikic/php-parser. As Nikita Popov (t= he maintainer of php-parser) wrote, =0A= =0A= > Emulating #[] lexing on older versions will=0A= > definitely be a challenge for PHP-Parser. I don't think we should make=0A= > concerns of external tooling hold us back too much, but the phpcs argumen= t=0A= > really doesn't hold water.=0A= =0A= Comparatively, it would be easy to join two adjacent `@` tokens to a single= `@@` token in a single pass over token_get_all.=0A= Parsers would likely already do that or benefit from doing that for tokens = such as the `match` token (T_MATCH) in php 8.0.=0A= =0A= Another commonly used static analyzer is Phan (https://github.com/phan/phan= /) , which I am a maintainer of.=0A= My reasons for preferring `<<>>` or @@ over `#[` were mentioned in https://= externals.io/message/111218#111239 .=0A= =0A= For phpcs and other linters, my belief is that this might be easier for sim= ple use cases in the short term,=0A= but edge cases or ambiguities like multi-line attributes or refactorings th= at were safe in php 7=0A= (such as moving `#[]` behind other tokens to another line)=0A= may cause issues for users of those tools (until those tools drop support f= or php 7.x and older).=0A= This is why I'd advocate for a distinct token that doesn't overlap with lin= e comments=0A= =0A= Cheers,=0A= - Tyson=