Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113765 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 3527 invoked from network); 25 Mar 2021 13:16:27 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Mar 2021 13:16:27 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 762041804DD for ; Thu, 25 Mar 2021 06:12:28 -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_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (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 ; Thu, 25 Mar 2021 06:12:25 -0700 (PDT) Received: by mail-lj1-f172.google.com with SMTP id u10so3035096lju.7 for ; Thu, 25 Mar 2021 06:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=eWIIHc7wzXoySZCuvtFANRRzc2rfHjQv6bvAoJahskY=; b=gNXDoBKUC1Z6xPjq3JyNZ8kD1/GGr7coyU3kP3is1G6EuBYHPHTnKwWjvPsKmkjhr6 JgdapHJcnyPQBhca4cAKtubI9ZryqOA83Gzn9etNSe2c5FQ7Pz/pUPWUk+YmLlF1p9ga pzKx01b2+JvoUnogy1KW2zFrwImgM5EliKue/i54DQDt5IWAFSjCs2wuIwKv2E2qRo2m YdtXvVYJb4uYF/On9oa2HQ02SNhqGmhYloro0CN2vizGSzurVLeoIg2mOjUMTXmQeJbv AZRhAwTjLH7hG1QugnBpFBZz2v8e6MGn3/jQvuTrZkMmjEaDHiE54ax+PRq9fFGtnNOR nI3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=eWIIHc7wzXoySZCuvtFANRRzc2rfHjQv6bvAoJahskY=; b=P1af6sn0tVtf+by3IJp0j0sw7v8eRg4el4d57ONOIUnGbujn055+M0Q9AnjRwBhYMG AI2lU1gIonkLEzUp7m/z3F8qQJ3u2Y3/dZ9cDIG6q325jR56erd+6+o3H5s7K+zqUwiH IjjmTWdIXn19iQVOhDGHfl3GyNCuTOgDg8SSG23Do9jRk4A0fK1DCqFmL86HVHm+XtTq xxiG+ciVDDY6Q7t+pQ7juS4yOTUEnkgEMHhOgKpM1ay7NEXGKWBXss/NRqD+bbNZJvYo vnP5X65o4ho8ASaxCT26Eh1HsAm87GKnmuI5gp+PRVYLqnReHLv7R4nb6zsPI/oWpOYZ 3cWg== X-Gm-Message-State: AOAM532/TlNDIm96D5BJGuREtXLT8OCEsFh4KUYi4o9/bqbaruDxSi28 KSh8zhPDC8WJx2BAzw8gu1LTSY2LjnM73G3uO3N561b0 X-Google-Smtp-Source: ABdhPJyMiW9PUcP/OU4dHxQW0xUTdsOwf2d7uCX0068J9UzrS+HIGt5DOGbxHLWeC0aTswkVjeTLUSOUnV9HvKjUjaI= X-Received: by 2002:a2e:9b90:: with SMTP id z16mr5521904lji.71.1616677943558; Thu, 25 Mar 2021 06:12:23 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab3:5f8f:0:0:0:0:0 with HTTP; Thu, 25 Mar 2021 06:12:22 -0700 (PDT) In-Reply-To: References: <88c9eb5f-f80c-4869-b7f8-1b58b9e2eaa3@www.fastmail.com> <4DC3B66E-A91A-4AA9-8872-8EE9DE92C2D4@cschneid.com> <8c72c162-83c0-7c7f-2fa7-4fbe3fb30a4a@gmail.com> <605bae82.1c69fb81.f49f7.d11eSMTPIN_ADDED_MISSING@mx.google.com> <919e30e7-3e5e-d955-7bb4-1e1b5825cdd1@gmail.com> <635DD146-FC6F-4991-8D2C-5A6B492722D5@newclarity.net> <734f12de-da98-6b76-c2fe-8682f4d177aa@gmail.com> Date: Thu, 25 Mar 2021 14:12:22 +0100 Message-ID: To: PHP Internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2 From: olleharstedt@gmail.com (=?UTF-8?Q?Olle_H=C3=A4rstedt?=) > prettier to read Are they though? Because if it implicitly captures anything in scope, there are more lines to read to figure out what's actually captured. 2021-03-25 13:31 GMT+01:00, Nuno Maduro : > Hi, > > Thank you for the feedback on this thread so far. Programmers are > opinionated, therefore you will find developers that see themselves using > this RFC and others who don't. Just like "Fibers", "Type-hints", or any > other feature in the language really. > > The reason why we believe the vast majority of PHP Developers are going t= o > appreciate this RFC is because multi-line short closures (aka > Auto-capturing multi-statement closures) *are more simple, shorter to > write, and prettier to read *=E2=80=94 and the community love these chang= es as > proven on "property promotions", "one-line short closures", etc. [1] > > Besides, one advantage of this RFC is that it is consistent with the > current syntax of the language and with the short-functions RFC[2]. For > example, by proposing that "fn" keyword indicates a function will > auto-capture variables, by value. And, the "=3D>" sigil always means > "evaluates to the expression on the right" in all circumstances - one-lin= e > short closures, named functions, arrays, and match() already follow these > patterns. [3] > > On the other hand "use (*)" has no usages / or current meaning in the > language. > > Thanks, > Nuno. > > [1] Pretty much "Brent Roose" have said here: > https://externals.io/email/112010/source > [2] https://wiki.php.net/rfc/short-functions > [3] Check "Auto-capture multi-statement closures" - > https://wiki.php.net/rfc/auto-capture-closure. >