Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118144 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 15961 invoked from network); 30 Jun 2022 17:56:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Jun 2022 17:56:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9A62B1804D0 for ; Thu, 30 Jun 2022 12:48:12 -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,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 30 Jun 2022 12:48:12 -0700 (PDT) Received: by mail-wr1-f49.google.com with SMTP id e28so160951wra.0 for ; Thu, 30 Jun 2022 12:48:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=2BK7NcjnBvXZz2c1IX2rd7dwFmo2E6xC3W3D8rvExPs=; b=MgWLVwBDHsKDKDemWG10TKC3C4Rbxuz8xsHgt+M40RWcokWeM7SPyh4numkI53zuSG T8tV/kbLsI0NLjnJZ0OZP/q4YVQ9DpOQoWToUBqmo87swnY0ve9snaNtVSJYPh+7O2mf jYqMYBuLOZbRpT+H10Mx2oz+rCTUXz3vajRP7QUJa6/LYmvTqd7fUK39x+250xCyNIFl SSRnOTkl0KUw813m9ZHQfL2piKwIVYRHo2SPplyp5ggJuqF4H8uJ9IW1ko5sMcJLkcEp N/F2iq5hvBY38XmBUb0osIMtmssMiU4gCq3jNVHxPXxex5CnyVy6T+TnzuMCCQF3g1BK HRBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=2BK7NcjnBvXZz2c1IX2rd7dwFmo2E6xC3W3D8rvExPs=; b=Hqupbzkl5CNeH77HQReRbjSAy8e5e7jeKa6Cp+wGTBO3h2mcsnMYRkilThzhCAgaas B3Z4USGc84648xTGYBDjiVwz/O4Vr1bC5rAUqZCY2ULWNJ1KH4M2On2YGRcGq8o0dsBn qt1R9+SAeVA2T5RtuZuV4Ff7vIPLv7u3s+Dd802//9COFofbs/9tm2FOArrvRY37djJt 2oc5N91OtT/1CGAYBn8BysigxpzK1sPO9GKXLbJcwl9VHu4byBv3jX98K0+JfVcICS6H u/Xgqdv3Qt21T8lVag6bInF+UnlJKmqfSnqj/yUwRaY2HnYc6ciLaEV46DAa+BFnL5tW 4cWw== X-Gm-Message-State: AJIora8SKnMOI+QR/g4HteBT8YhoWF4z1IHPtW35gGAYcKAu9CsnGr7i 2fsljrF0OeLOdrIz9dvjzTEACBTB/iA= X-Google-Smtp-Source: AGRyM1uZXlctq/UFiK3lcvm+5zMOmWdRAj6bE7Ou6/NS34jtzotd/1HOKNWZbmloSmgpCvXSToMHWw== X-Received: by 2002:a5d:55c7:0:b0:21d:407c:cf1b with SMTP id i7-20020a5d55c7000000b0021d407ccf1bmr3326817wrw.630.1656618490881; Thu, 30 Jun 2022 12:48:10 -0700 (PDT) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id x2-20020a7bc202000000b0039c18d3fe27sm7495445wmi.19.2022.06.30.12.48.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Jun 2022 12:48:09 -0700 (PDT) Message-ID: <90ccccc1-3129-556e-2224-6a3b4164b047@gmail.com> Date: Thu, 30 Jun 2022 20:48:07 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Content-Language: en-GB To: internals@lists.php.net References: <2b35605f-8da8-46b1-aec3-00bd1bfe47fd@www.fastmail.com> <7513519.rnE6jSC6OK@arnaud-t490> <5584889.DvuYhMxLoT@arnaud-t490> In-Reply-To: <5584889.DvuYhMxLoT@arnaud-t490> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3 From: rowan.collins@gmail.com (Rowan Tommins) On 30/06/2022 18:37, Arnaud Le Blanc wrote: > On jeudi 30 juin 2022 18:29:44 CEST Guilliam Xavier wrote: >> Ah? Sorry, I had interpreted >> https://github.com/php/php-src/pull/8330/files#diff-85701127596aca0e597bd796 >> 1b5d59cdde4f6bb3e2a109a22be859ab7568b4d2R7318-R7320 as "capture the >> *minimal* set of variables for *both* arrow functions and short closures", >> but I was wrong? > No, you are right, the PR changes arrow functions too. But in the RFC we > decided to not touch the arrow functions for now. Personally, I would be in favour of leaving the change in for arrow functions as well. The fact that a variable of the same name, whose value is never actually used, is captured by the closure, is to me a bug, not a feature. It's hard to even contrive an example where this is observable, so I highly doubt anyone is relying on it. Regards, -- Rowan Tommins [IMSoP]