Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110715 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 5041 invoked from network); 24 Jun 2020 16:35:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Jun 2020 16:35:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 270BE18054A for ; Wed, 24 Jun 2020 08:22:53 -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=0.0 required=5.0 tests=BAYES_20,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-ASN: AS8075 40.80.0.0/12 X-Spam-Virus: No X-Envelope-From: Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12olkn2049.outbound.protection.outlook.com [40.92.22.49]) (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 ; Wed, 24 Jun 2020 08:22:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YXC4ofptJP/hepYWskjpvBwgmjhCHQqv5s1coquCIxp7KAH8BmL8tEbbw2CubQsoLieqmbWhnkP6AB7WUY2RJS/NcIT3ptww0QZhiM+VYxmcKOhYc+xGUCg/2ECDccdac+UYs6vsBhDrqBGcNa60iy/QHhV5gdH2InC8HqgyuTNQsj8CbK0pZiFFWDXuZiwsxHLX6DR+5pv8PJNrPb/cCntFw+Yqx7gI3qSRSKJkoN73sJuA2VwUawjxKy9i4qf3iWBBUxtzZv0sGqv3hiYTbA3MpQ568re9GGHcTf9CPWaBKIC2aEtgiKyLrHtnvH8PHdkmzxtqgLiyggZpVARs+A== 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=mXurLRwHT6DJFMcJq/Zqdikjq4MVjHE9+tP+lxjixeQ=; b=V0ZTYUEBYyPvN7cruilBaGXcVdpdncDLCpHibVbaLscaawD261GPUobDuQfN7g++jwUd8Lov1P+UDUviYPRtIwwc9a+cNoZZzQdhJqhXzOGhMPk4iR0xHSR4d9bGx8vAyWhZaRCfyn4cG8M9EsT4MD+ukT8bQTm+Jcs1haLDOFcrVVU33y4Xy730dWiAMusFJR3J0CyEXl/Sl7q7aGtAb8UWA2eIl+O3VLg6hW/vqHzqowkLFa3kILhCvFibinsxNAsxWZIteZWaL4R9KNHpIXv4duYh7xSZAZO8pkoG6DZib7lJQ/ScMfg6uXN/9hrNVu91h3d84l8pKHBO9m9SiQ== 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=mXurLRwHT6DJFMcJq/Zqdikjq4MVjHE9+tP+lxjixeQ=; b=Z7nDXJaJkXt8udgkvThrbvKxk0L9PY/w1sCfrhP9zoo6b2y2n/Vx6EkXOLko21jUAUrEjqUK9nxeKS0NVKr03e9STepY9TP7uywxoxYPw2Ci+eUIdberPcwARiZnl2i7DUpfIe7tGUqvyHuIUXzOgRbwUG6MIfweQUFPbG2xAPQ2CrPBtZZliRB1JFv3iHVYSlcpToNfZwaDqGDo0lvFeftBVOP5p0PMwt+aBhFoPWClD49VcBS4Ga0x/42VcogZtunFqli+kx0QFcnpGeTHMLtgF5QHMj1hMzpEQfAVMZxtf059G3g78l2zJWG22VjnxGmAjSXTiPA+ECxep060/g== Received: from DM6NAM12FT058.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc64::40) by DM6NAM12HT196.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc64::64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.13; Wed, 24 Jun 2020 15:22:51 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:fc64::51) by DM6NAM12FT058.mail.protection.outlook.com (2a01:111:e400:fc64::461) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.13 via Frontend Transport; Wed, 24 Jun 2020 15:22:51 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::f0c8:f413:c7c1:e934]) by DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::f0c8:f413:c7c1:e934%4]) with mapi id 15.20.3109.027; Wed, 24 Jun 2020 15:22:51 +0000 To: "internals@lists.php.net" Thread-Topic: Permitting trailing commas in closure use() declarations Thread-Index: AQHWSjp7mCPFPUp01keDom43SRjbug== Date: Wed, 24 Jun 2020 15:22:51 +0000 Message-ID: Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:56401FC2775136AB26F7A3016C7B107C025A09F65E42FC78830846E16E9B8A33;UpperCasedChecksum:BF8C059E892E5ABA64ACC060A30A74544157C2C604A1013FB449E19BB3BF2C6C;SizeAsReceived:6683;Count:41 x-tmn: [JgDeGkr/4qs8LId+ae+29kzpihfvoRg8] x-ms-publictraffictype: Email x-incomingheadercount: 41 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 8052c50e-ee22-4fca-6be7-08d8185275c4 x-ms-traffictypediagnostic: DM6NAM12HT196: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: O0o33LHSm9dk/jJxiqDEtF6gYr41LeYMuUD15bpHPRSOjXRhwf8L21QCB/HR5G49V5NGDGfrkxc26XTWqhLIcZcnvWVlDTL2uuyRxSICXA86F0OYtKyvtrUFT+f3DBtngsPsbSUn0TKHPFmLSoCgTc8huTvEnTAxJygLN0Fp+7nhZJMHgpu+GZUjdQxiStfTdZquBmawiA0o8/ZqQL2E6IEAFQrE65I98n42BEjuNVLt/KE1txnPIb4qAXvEYQTR 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: prZDFw6hdUrxIhLOypkU+AKUVKfQ+ij0JZWhXfS35cbZ8YGURj1LW94MnDmT9hZtEeT0KBEfI1Fyt2Fi04M5RXcZuHGIKywm7L2smIt8qVs2giAXGXmjZB0tZCrdtYm+MMBoB5/ne8a97Urp3CwEEw== 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: DM6NAM12FT058.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 8052c50e-ee22-4fca-6be7-08d8185275c4 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2020 15:22:51.4177 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM12HT196 Subject: Permitting trailing commas in closure use() declarations From: tysonandre775@hotmail.com (tyson andre) Hi internals,=0A= =0A= https://wiki.php.net/rfc/trailing_comma_in_parameter_list mentioned=0A= =0A= > https://wiki.php.net/rfc/list-syntax-trailing-commas Trailing Commas In L= ist Syntax was a previous proposal to support optional trailing commas in a= ll list-like structures.=0A= >=0A= > Nothing has substantially changed since those RFCs in technical terms, bu= t I think the aforementioned style > for breaking up large parameter lists = has become more accepted in the meantime, and features like Constructor Pro= perty Promotion are going to increase its use further.=0A= =0A= So I'm wondering if anyone's interested in revisiting this:=0A= =0A= - It'd be easy to forget that function parameters support trailing commas, = but not closure uses, especially if you're new to the language.=0A= - Supporting trailing commas in multi-line declarations would make version = control history easier=0A= - if you had a closure for which `fn` wouldn't work (a list of values *and = references* to use, or a list of statements),=0A= it'd be convenient to split it up across multiple lines=0A= =0A= e.g. =0A= =0A= ```=0A= $incrementing_id =3D 0;=0A= return \array_map(static function (array $map) use (=0A= $function,=0A= $some_data_structure,=0A= $some_flag,=0A= &$incrementing_id,=0A= ): ReturnType {=0A= ```=