Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110716 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 6695 invoked from network); 24 Jun 2020 16:37:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Jun 2020 16:37:42 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 81B17180549 for ; Wed, 24 Jun 2020 08:25: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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 24 Jun 2020 08:25:09 -0700 (PDT) Received: by mail-qv1-f50.google.com with SMTP id h18so1218291qvl.3 for ; Wed, 24 Jun 2020 08:25:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=benramsey.com; s=google; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=0+c7Fstd7yLsVlaye21qwZlpVDBxSa+fZv8idNf4VIQ=; b=OlyzpNeLJdMeEH3UsGMySo7+Jt8fc0tJYt5C0REk6E4qoufZLWKoV9basDkAQBCQ5x QLCZe3NlwZNB8EKhNw82kjYGTmLKw+21SvmIua20KQZ6qpdfO1q4ukoezSnUcT3CQEPc FTRnlsc6p4FvR8kq1zwlUgBEBaDE1cqSHwMgPegMVxqq5bfrrK3RprPuodzM9u/PrkVp 8IukuGODJl193gz98RcXrFJIA8EXVRO0PhcySyv22m6fJHHuvEbISb9NEAFTF/LuEZZJ LxOB6yte2jIukLR3fY0USiNUZ9FEaLKCXJClbXlRsSkoBkgJ2zjumfGx5UfEcG7hMzd9 b5ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=0+c7Fstd7yLsVlaye21qwZlpVDBxSa+fZv8idNf4VIQ=; b=IFFW6ipjtpivWTaLAJ74TP+IAGEsRSKGkNJV7HFAf6UzGV2MJ7C2p5HPhT9MLHbYTw rF4TuphRTTSOVargXqnc+ZNQpYs+zROcPS5otGGlcaYdNR1VmEtV1HUZTV0C+uBJow6I pMQoqj5CbjAARP6FpzOxMMA6pzYmZaf7q4+j00AmDGHMPDIqRgDPbhT84Km6Zd6YdHt9 gFZUkmU9hjzE2lnr+tpxeWL2+g7jHV3jJOYyl3FHs7eHW5pM+8IdtRHiuBMnOC2EIJBh EwCTYdSGRYhE+Lm5jpRBBlh5Mfl5yUY9qzXMxDrO4qEZmALVGK95bmenmWNDfUQ+xxmc vCEw== X-Gm-Message-State: AOAM530MH5CF/xmM6dir3OOAIZ7Guc8bTdloS0o/v4uaNsVVZgy/lmSH MruWH2Q4Qi9RdccKr0aVWNAFAg== X-Google-Smtp-Source: ABdhPJxtI+0zHRGhm3bFQ6nzc7A0+TjE/2QpsH1QlOSm5iI1A+I5ttcyzzxgPeWoh1DWIA8kVS4HKw== X-Received: by 2002:ad4:4513:: with SMTP id k19mr2092733qvu.122.1593012305820; Wed, 24 Jun 2020 08:25:05 -0700 (PDT) Received: from ip-172-27-233-59.ec2.internal (ec2-52-205-43-144.compute-1.amazonaws.com. [52.205.43.144]) by smtp.gmail.com with ESMTPSA id b53sm3935588qtc.65.2020.06.24.08.25.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jun 2020 08:25:04 -0700 (PDT) Message-ID: <13A2D674-778B-4B5F-955F-1E5F79C2E87B@benramsey.com> Content-Type: multipart/signed; boundary="Apple-Mail=_FB1A6125-3520-4D2F-8037-6289E041EC21"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Date: Wed, 24 Jun 2020 10:25:03 -0500 In-Reply-To: Cc: "internals@lists.php.net" To: tyson andre References: X-Mailer: Apple Mail (2.3445.104.14) Subject: Re: [PHP-DEV] Permitting trailing commas in closure use() declarations From: ben@benramsey.com (Ben Ramsey) --Apple-Mail=_FB1A6125-3520-4D2F-8037-6289E041EC21 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Jun 24, 2020, at 10:22, tyson andre = wrote: >=20 > Hi internals, >=20 > https://wiki.php.net/rfc/trailing_comma_in_parameter_list mentioned >=20 >> https://wiki.php.net/rfc/list-syntax-trailing-commas Trailing Commas = In List Syntax was a previous proposal to support optional trailing = commas in all list-like structures. >>=20 >> Nothing has substantially changed since those RFCs in technical = terms, but I think the aforementioned style > for breaking up large = parameter lists has become more accepted in the meantime, and features = like Constructor Property Promotion are going to increase its use = further. >=20 > So I'm wondering if anyone's interested in revisiting this: >=20 > - It'd be easy to forget that function parameters support trailing = commas, but not closure uses, especially if you're new to the language. > - Supporting trailing commas in multi-line declarations would make = version control history easier > - if you had a closure for which `fn` wouldn't work (a list of values = *and references* to use, or a list of statements), > it'd be convenient to split it up across multiple lines >=20 > e.g. >=20 > ``` > $incrementing_id =3D 0; > return \array_map(static function (array $map) use ( > $function, > $some_data_structure, > $some_flag, > &$incrementing_id, > ): ReturnType { > ``` +1 for consistency with allowing trailing commas in all places like = this. Cheers, Ben --Apple-Mail=_FB1A6125-3520-4D2F-8037-6289E041EC21 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iHUEAREIAB0WIQToXQMR3fpbrPOmEOewLZeYnIwHGwUCXvNwTwAKCRCwLZeYnIwH G8HfAP9EgAZkEJ6T2xHok+WvR/hX1eSv5zZHZOpcYfxXHDz/PwD+NUObFFS7Bqds IskToKZzWf8sokttbjtMOE4bIstFq4c= =TRbC -----END PGP SIGNATURE----- --Apple-Mail=_FB1A6125-3520-4D2F-8037-6289E041EC21--