Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113771 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 15558 invoked from network); 25 Mar 2021 14:27:17 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Mar 2021 14:27:17 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AB543180504 for ; Thu, 25 Mar 2021 07:23:18 -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=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from darkcity.gna.ch (darkcity.gna.ch [195.49.47.11]) (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 07:23:17 -0700 (PDT) Received: from wafer.home (unknown [IPv6:2a02:1205:5053:a220:f586:6cb5:8594:8b46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id 2891C150ED1F for ; Thu, 25 Mar 2021 15:23:15 +0100 (CET) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Date: Thu, 25 Mar 2021 15:23:14 +0100 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> To: php internals In-Reply-To: Message-ID: <5D33D73A-6B75-456B-9774-91F71FF450BA@cschneid.com> X-Mailer: Apple Mail (2.3654.60.0.2.21) Subject: Re: [PHP-DEV] [RFC] Auto-capture multi-line closures andshortfunctions take 2 From: cschneid@cschneid.com (Christian Schneider) Am 25.03.2021 um 14:29 schrieb Mark Randall : > On 25/03/2021 09:28, Rowan Tommins wrote: >> That's not quite what I meant. I meant that you can't say "capture by = default, but this variable is definitely local". >=20 > I think if there's one argument against, this would be it, but IMHO it = is a weakness in PHP as a whole. I'm not sure if I misunderstand what you're saying but to me it is one = of the greatest things about PHP that everything is local by default = (minus a narrow set of well-known and easily enough recognizable = things). > The solution would be adding JS-like let / const statements. Which = would be a benefit to other things too. I disagree that this is the solution. I think JS had to add var and = later let because of the unfortunate decision to have C-like scoping = rules. Making scoping in PHP more complex to be able to repeat this mistake in = some form seems ill-advised to me. - Chris