Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118161 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 70625 invoked from network); 2 Jul 2022 10:31:48 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Jul 2022 10:31:48 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D260A18037E for ; Sat, 2 Jul 2022 05:23:48 -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-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 ; Sat, 2 Jul 2022 05:23:48 -0700 (PDT) Received: by mail-wm1-f51.google.com with SMTP id n185so2745108wmn.4 for ; Sat, 02 Jul 2022 05:23:48 -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=pyQhpnmK03hGYdz0MWWafOLc5n9SVrIJiqj1pOnf8Y4=; b=HYNA+BLqtwj4/A7fGJXrLD8+DtErz4FyBC08gSxNgHohbfezxJEf4shf9zxhBOuvyL 9ZyhF+3tTy9NuKJnzkyIsg8nBchHyTT0uKCUYfFv4Ui0SqXUdbmDCANPANQCMweWGHeu tsETwEFc2MXbIGHVk4jyidINe1SbWQe7Rp92dMJb+fh7rLCupHvm2hb18Q64AnvcmUv0 Z3sULUdW+vwViPX+FkOO6dRgn69XFP1O3L/wtA1wnyrxOrC7fJWQz7ckEFctQyPu9FU7 4m4Fq5cgkvi0qWr7JwKZUZluzQKR7pn25t71264K4N24NxwakSZk0NpXXoE5OeP/xsHg RPrQ== 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=pyQhpnmK03hGYdz0MWWafOLc5n9SVrIJiqj1pOnf8Y4=; b=sPLg2Yok5mijJ5gp7V09LCbKQnHlmampWI1/9lvB3ssD7PfTLUdBo2OgEfuTCAnuW4 SEjb29aJvVnplLcL1eCGQIHPi3peGB1uhvnq7UrBIKjlrxA1g+FycDUDm+dK/J/KJQGl 5psT7XiIeHnopuhPvtUrCH9Fm01rkyKPSjL0kIQ+X1sW3mr7+RFFuV4tRTtgVuaQ75F4 PNAXe+jxc2YSOJGEfZmymrvLGK0ckLWsiOU//GW0M9bD3tyyEh5EnXKBMd79W/Yg8/qs +kP0DfVYbaNi4OwiZb/OWIK+AmiMqy0/Pn07L8lhhKVsbInvTrsEKCq5ktJAjd3wqll4 H4uA== X-Gm-Message-State: AJIora9ejYBmUJFUrjzyuTNYMe0q9Q02hA8OwJyybbmj5bZLjq3E/YwF aQEdWSTiEWE0jETQTG1TrkhPM3V7UE8= X-Google-Smtp-Source: AGRyM1td9/Fw5eSbwstHEqGIwS03dXCSiOIKX9mcQOib3SXW21Mi2XHxVYFwsd2ioitwiC7VM4Q0NA== X-Received: by 2002:a7b:c310:0:b0:38c:f07a:e10d with SMTP id k16-20020a7bc310000000b0038cf07ae10dmr21415695wmj.110.1656764627347; Sat, 02 Jul 2022 05:23:47 -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 r12-20020a05600c35cc00b003a04e900552sm11290987wmq.1.2022.07.02.05.23.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 02 Jul 2022 05:23:45 -0700 (PDT) Message-ID: <3ff0a583-318f-acca-33f0-7a8d847fa588@gmail.com> Date: Sat, 2 Jul 2022 13:23:40 +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: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][Vote] Auto-capture closures From: rowan.collins@gmail.com (Rowan Tommins) On 01/07/2022 15:04, Larry Garfield wrote: > Greetings, Internalians. > > The vote for auto-capture closures is now open. It will run until 15 July. > > https://wiki.php.net/rfc/auto-capture-closure > I have voted No, because although I am more-or-less convinced that auto-capture is a useful feature, I don't think this is the right syntax for it. - Having "fn" and "function" mean almost the same thing, but with such an important difference, feels like a WTF waiting to happen. - The RFC seems to take for granted that shorter syntax is better, calling explicit syntax "noise"; but in that case PHP contains a lot of "noise", and I'm not convinced that removing it would be a good thing. - This emphasis also implies that auto-capture is a near-universal improvement over explicit capture, rather than an alternative on equal footing: it is the version that deserves the very best syntax possible. I remain unconvinced by this. - Unlike other languages, PHP normally relies on opting into scope imports (global, $this->, etc), so lacks a mechanism to opt out and declare a variable as local (var, let, etc). The proposed syntax offers neither opt-in nor opt-out, relying on the implementation to do the right thing automatically ... most of the time. To re-iterate, I am not opposed to the feature in principle, but would have loved to see a more open exploration of different syntax options. Regards, -- Rowan Tommins [IMSoP]