Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113763 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 98648 invoked from network); 25 Mar 2021 12:35:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Mar 2021 12:35:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2B78A1804DC for ; Thu, 25 Mar 2021 05:31:45 -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,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) (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 05:31:41 -0700 (PDT) Received: by mail-ot1-f41.google.com with SMTP id g8-20020a9d6c480000b02901b65ca2432cso1747407otq.3 for ; Thu, 25 Mar 2021 05:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=ir59xYBgaNsSMY4NuGwKB4LHdANlyL1PLLoFBmvoroE=; b=crvEBIfE0z58y6bmv1pOnQYGumJAdh7q2LVZ1rPnuoLmhwnMSF59k1N62gFNuaXSI5 Gce7aKwv/W/8Nolci8TH0FHLMN/AYmowuPzvls6CoeJqwlmQdHn0nqDraNH29qIWJroy WkN5GFAH3avAsQ87HySaiE4MYvySksUsKYAD0A4EgW0/TWfDLOzb8Hax8OfRZ5v+erlh GWGSVMlWMkxBq6B8rcX4vkVzwpNigZAniRp+2AKb1gNTIhYIC+Fsl0sb09fpPNZISToj oF6zwntxMeIEOy9RpS4a0JkeRQ3+Em3gXyoKAWPwySG3ETN7/h4A031voclkBd7kWWsi qxFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=ir59xYBgaNsSMY4NuGwKB4LHdANlyL1PLLoFBmvoroE=; b=lCwld8YIB65ZTzd5LptQ/Qq9qjUq7HsiEuXJclEfrLI6Uzg7EaTXIoCPSdd8NqoQxa PklvBkknIa6YR5+OgamcROhU6Yq4eHHWVoS02g6K4Jz0AqhZ6yI5zuPzxAKZAwBznSYZ 7S8+9ybGSfq57jq55TtKl5rkfgvV+kHTqYh/y/2Pjtrvq7/t9rFPGQ4xmDr9Rx5sI1Uu 0h4mjHHRY6Hg5wkGp31hF0P5IcXhfCL8ubNUi66hz2l6wvOEHywuKLo5oIj+hntM/LNL 3Ecl70Jni4pSi/0Kycio3VB+uI74aFK5Bl38g5saiXNS+ue1sLI7eoU8YGoE29Ro2kF6 GKig== X-Gm-Message-State: AOAM530fwW0kJuatP5K7pW5msf69QJrkNiHlXy38XAuibWZV5UEJVAV3 KVzxmAkqHXWy1dqctQo7nZmeYdk3g90ZnZxAikR1BlXMS4NqKcpm X-Google-Smtp-Source: ABdhPJyqvhB8ETDwvdDWiAnl+t3OznajqJneKKTyBnJlpgQow386KLVL+p8+Hq43DVYMoI6eHk8gyY7UKUcK30J85W0= X-Received: by 2002:a05:6830:2472:: with SMTP id x50mr7225760otr.69.1616675499289; Thu, 25 Mar 2021 05:31:39 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <734f12de-da98-6b76-c2fe-8682f4d177aa@gmail.com> Date: Thu, 25 Mar 2021 12:31:25 +0000 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary="000000000000da31a305be5b9853" Subject: Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2 From: enunomaduro@gmail.com (Nuno Maduro) --000000000000da31a305be5b9853 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 to 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 changes= 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-line 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. --000000000000da31a305be5b9853--