Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118159 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 37255 invoked from network); 2 Jul 2022 01:10:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Jul 2022 01:10:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 032C8180503 for ; Fri, 1 Jul 2022 20:02:06 -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, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS398810 136.175.108.0/24 X-Spam-Virus: No X-Envelope-From: Received: from mail-108-mta2.mxroute.com (mail-108-mta2.mxroute.com [136.175.108.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 1 Jul 2022 20:02:05 -0700 (PDT) Received: from filter006.mxroute.com ([140.82.40.27] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta2.mxroute.com (ZoneMTA) with ESMTPSA id 181bcdba85f00095ec.003 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Sat, 02 Jul 2022 03:02:01 +0000 X-Zone-Loop: 75a26fdc64350bb5ff003a184ac40eaffb1c41a27a4e X-Originating-IP: [140.82.40.27] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sandfox.me; s=x; h=MIME-Version:Content-Transfer-Encoding:Content-Type:References: In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=IlnAZM0EN1b/hb1l2iPUkeI1ChajqHx4RN525Z1jY/g=; b=uQrYvT2ms8fciPHDRawE/gR/EN 8te1inqeoAqvGBugnIWBNDb3pf18W8N5eYcB1chGqKzZwv/SrQacGSBZxPvzLPW0PK/CBlQw+/dKc 82NOF+O+zlWeznJLIis1acGfEuUdC2rbhQv0x7l6l71KfMVYLrGA4E2FTvjyiJQWpmwGvsGM3f4QZ uiW0UHmQzXWVzz/hTTAZfY4XZq63qUdHfKGx53fz1w95zmjx2yK4/RfViPaJEWBL90H6ITRwAZB8f RgnYVlrtM2yjy3ecIGsgHNcGZo/nlEJLFltZdgZ0TsrT8iBOPHLQKu2aCmh4lAcEUCVR2AsAdqV9t Y9XnzAAw==; Message-ID: To: Hans Henrik Bergan , Larry Garfield Cc: php internals Date: Sat, 02 Jul 2022 06:01:58 +0300 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.2 (3.44.2-1.fc36) MIME-Version: 1.0 X-AuthUser: sandfox@sandfox.me Subject: Re: [PHP-DEV] [RFC][Vote] Auto-capture closures From: sandfox@sandfox.me (Anton Smirnov) On Fri, 2022-07-01 at 16:11 +0200, Hans Henrik Bergan wrote: > > As far as we are aware, only two languages in widespread use > > require variables to be explicitly closed over: PHP and C++. All > > other major languages capture implicitly, as is proposed here. But do any of them auto-capture by value? > to be fair to c++, it supports [&] to capture everything, like > int a=3D1,b=3D2,c=3D3;[&]()->void{std::cout << a << b << c;}(); I think that's still explicit --=20 Anton