Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111462 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 43537 invoked from network); 11 Aug 2020 14:03:37 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Aug 2020 14:03:37 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B9D2A1804D9 for ; Tue, 11 Aug 2020 06:03:01 -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-Virus: No X-Envelope-From: Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-oln040092011096.outbound.protection.outlook.com [40.92.11.96]) (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 ; Tue, 11 Aug 2020 06:03:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GavBCL7hGXBsK3x1UOP6Do2FeQH+aPgcdn2grgqbqaI9m0fBrxlGk3Mm3bm+mAgCh1j5r9xgnxaS86RdQYWdaE0GVkVwhAMQKnQIWTABlF89ghPBrVIsB2mCqRW3cjo7/3Em5Nq4+PbzxQ+g/bNKqf8kW3zvzU6Jp6umYdXpzu+J2CIN4oDmFyxMF96d7XWdkhindAxCpLJ6K1TM8/bZTRp2I8k4kS6oBtHjQTPJDuLFcOy9sEC+v+01AUflJphCqXnq3QfMUVrtupTYNfuf3nIfbebSRZK1+MI8E3rNCgLNSimmEZg/UFVvvVbLe+zfAwxn5xLqFt5qumgSav0fvQ== 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=nUhB0shGrcHfzCoDk+iFJwYFK9QzlYZPLy9TT4PpTKg=; b=UcaODD6E62coDDeYsJ9Q9ZbzJvTwyyB1GJqRc6VmXPDVlw1lghQawLGtNRdWcURKqexygZi5bz3O3Zmcw6c6vqVH5v6eJAg1251q2Bi9yAvdfzjlTvSYop7ZOuwt2miZJNvcVBxdzMTCTVbQoAlksYh7/gJGq8oixLtt7qAgx2rlLSyWlAtcb4snafBQstEhYP5MF5ae874bqAx0y2dYChxfph8JGinz4vH0vKIL1ZzzmJNG7H8odFMb/9UYm1IfCf+AdoLrM9iqu+CG1h4+oNNNpY6a5vjPEycbqmPFgnu8C6jBUjgH0kUVc3t+dvcUptKbIk0NPy06Oy4zjQfL5A== 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=nUhB0shGrcHfzCoDk+iFJwYFK9QzlYZPLy9TT4PpTKg=; b=a2URqZ4TFINpPFmhfOGAtWcZTY87POH8riEqQktnQCJKeNT3HoQ9jv+QzQvr84uVUqvcG84++NKW1R/lJjQaR02n5TOAoCBbO77cc8TEuBVftmbJR9XLsTeK5rbmFweVaJZ7FYW4Etw1wMvDWb42m43wnGie+/jzQ8aOuT1VTrnl+X/UmsMkzPhzT7LSSiggtNbTDWzH51gUz+WAjqSVuT8q6+ALXNWeBiq/K3rT8KwSBLkhhPLZ9jGswVQYYjY9GganXgWyRN5T+GIVVPAWBKj5puMQNNhTWdwvWDt3GV9WrrGgxcIZzHN4zVhpwrrdBy1u39pxgv0nawZogBe0gQ== Received: from DM6NAM04FT052.eop-NAM04.prod.protection.outlook.com (2a01:111:e400:7ea3::51) by DM6NAM04HT025.eop-NAM04.prod.protection.outlook.com (2a01:111:e400:7ea3::366) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.16; Tue, 11 Aug 2020 13:02:59 +0000 Received: from BYAPR05MB6535.namprd05.prod.outlook.com (2a01:111:e400:7ea3::4b) by DM6NAM04FT052.mail.protection.outlook.com (2a01:111:e400:7ea3::245) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.16 via Frontend Transport; Tue, 11 Aug 2020 13:02:59 +0000 Received: from BYAPR05MB6535.namprd05.prod.outlook.com ([fe80::fc6c:38b0:fa18:f355]) by BYAPR05MB6535.namprd05.prod.outlook.com ([fe80::fc6c:38b0:fa18:f355%7]) with mapi id 15.20.3283.014; Tue, 11 Aug 2020 13:02:59 +0000 To: Chris Riley , Derick Rethans CC: PHP Developers Mailing List Thread-Topic: [PHP-DEV] [VOTE] Shorter Attribute Syntax Change Thread-Index: AQHWbvIBydbCX+rhJUWK/r8c7hnlt6kysVCAgAAkzoCAAAFUAIAABrJt Date: Tue, 11 Aug 2020 13:02:59 +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:17CB105F87D15F5F2F85D262E16E453617FA1CC0AFA1954627FF9A6360519213;UpperCasedChecksum:FC99BB705C03D184B43573D6C8F05728A1BFAC8FA8CBE0E5DAE65E928FC1D6F0;SizeAsReceived:7202;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [N5NWpTMi/qdef+Z7KTh/GpeqISB2VED/] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 9d9928a8-e9cb-4ca1-7a86-08d83df6df98 x-ms-traffictypediagnostic: DM6NAM04HT025: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PwAtKSm5doTnuuqhBo/vH4x9cKT0KThbAbDgcnITV4uvsNA8rKdl/F+6Fg15TpQKlHNB2Rbamq29bs4srtf8mkvPqda4nkEtXZLGFMIrLDrc+rZIx7rorGc+fEjtfCXa03O6fNiQhRB/rFBF1KVVIeMw56nXxpnQuBKQdQQkvjOWDifFo7ZABula6g/Y2/mU0q2nyjeZg6Qk7xyO/xiyDA== 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: KyNnNPO+qdvVhHEa4V96xk4WUN8guogNlYfnCRNA0rCpGRmomIrocMOfyMXegfqgt/2aR37zJOn7kgGu+mgtQrb3rR3WGBijukZA6GmQ1XWcY4n6j23JRanxfLgYZKBW25B/VY6S94AD0PUk7osC7A== 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: DM6NAM04FT052.eop-NAM04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 9d9928a8-e9cb-4ca1-7a86-08d83df6df98 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Aug 2020 13:02:59.4636 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM04HT025 Subject: Re: [PHP-DEV] [VOTE] Shorter Attribute Syntax Change From: theodorejb@outlook.com (Theodore Brown) On Tue, Aug 11, 2020 at 7:26 AM Chris Riley wrote:=0A= =0A= > On Tue, 11 Aug 2020 at 13:21, Derick Rethans wrote:=0A= > =0A= > > On Tue, 11 Aug 2020, Chris Riley wrote:=0A= > >=0A= > > > Quick question.=0A= > > >=0A= > > > What is the expected behaviour of:=0A= > > >=0A= > > > @[Bar()];=0A= > > > class Foo {}=0A= > >=0A= > > That will error out in PHP 8, with:=0A= > >=0A= > > Parse error: syntax error, unexpected token ";" in Standard input code = on=0A= > > line 2=0A= > =0A= > Is=0A= > =0A= > =0A= > =0A= > on it's own an error?=0A= =0A= Yes. Basically this is an example of valid code in PHP 7 that will=0A= break if @[] is adopted. However, it will remain valid to write the=0A= following:=0A= =0A= @ [Bar()]; // suppressed function call=0A= @[ Bar() ] // attribute=0A= class Foo {}=0A= =0A= Is this still confusing? I think so. People could easily expect=0A= that the first line is an attribute, or that attributes *should*=0A= be followed by a semicolon since they have an ending bracket.=0A= =0A= **This could even make it easier to sneak vulnerabilities into PHP=0A= projects.** :\=0A= =0A= A second downside of @[] that doesn't appear to have been discussed=0A= yet is typability. On my keyboard, it requires four different keys=0A= on different sides of the keyboard, whereas @@ just requires two keys.=0A= =0A= Thirdly, the @[] syntax with grouping removes the ability to easily=0A= grep for attributes, which was one of the benefits of @@ mentioned in=0A= the Shorter Attribute Syntax RFC.=0A= =0A= Unfortunately, this new RFC fails to mention any of these issues,=0A= thus presenting an incomplete picture of the pros and cons which=0A= appears to be influencing the vote results against @@.=0A= =0A= @[] has had relatively little discussion compared to the other syntax=0A= options so far, and not all of its issues may even be known yet.=0A= =0A= Best regards, =0A= Theodore=