Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129849 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id C40F11A00BC for ; Thu, 22 Jan 2026 15:12:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1769094743; bh=np23YB16LX/02hleiHoaWH4lE5Kp6K5wAyDfp6bpeRY=; h=Date:Subject:To:References:From:In-Reply-To:From; b=Gi9HVJrPzbyUat9zHQxIbJs71p1/CgYy5A1hUC5oDcMyGM1gjZLJEUqjVSRnALZCK G+GMVJO5Oom/lstHTRh/YDb20vMKn+AGsoWcmrmOs36rlKQzyQ8sAHcF8JAVDBfc2m jvj3wJc1NFZBzU7xtae9uqeFucqVU+hs9AGeYAUyBZMTzOl4yQ1/VFLyujPowAuiI6 sjObO+HoJUWUQet9A8kKYJSnj7rWXzTHL+x7bk6VMTUZDPQtvFHJtbmOe8+alD8DGP c2IFkB1x2Z1rqAc67ljQnCH5EqyPXh+j22DQuyzoODWU2t5vBUJjdcHvl48+JFO98p 2bglsLP7Z8zmg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 99968180047 for ; Thu, 22 Jan 2026 15:12:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fout-b2-smtp.messagingengine.com (fout-b2-smtp.messagingengine.com [202.12.124.145]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 22 Jan 2026 15:12:22 +0000 (UTC) Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id B532F1D00046 for ; Thu, 22 Jan 2026 10:12:15 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Thu, 22 Jan 2026 10:12:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1769094735; x=1769181135; bh=cbDPsNPEZMbTvij0QxPeiLp/5pARqr+pVQpgx03rXDg=; b= JFg0yQiy+gCFwT7aL0RfXgtwvE7LYsvzMgyamIQYs8Fk/NESGxIF7Xmza671GztU v4W4kWvjVtzMR9p123DYZYDzPiV8O9KrpL9pWooM12D7JNj0RAXXaTkbADTm+8MF N1Die7J4aikqOWi3mKOxSacZoZCmCjS68w5Yzei6fTwhoexF6BmmuNPVSqJLE2xO vkia3tdDKxTUROw3Sfs+WhGXzs0VCJBKDYkhotmoG43IL3AUpgqkbVX02eNoNwQM RUiIMQm6BMCGkc9WGpCMueFoZu0apbnRw0R7nw7FHqV9X6QhmA+Hu9Y5jKvyzZfZ LL1eiaSo6iozKHyWy7lVPQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1769094735; x=1769181135; bh=c bDPsNPEZMbTvij0QxPeiLp/5pARqr+pVQpgx03rXDg=; b=MbqfZRhLHLcE29N94 5SbbUz4ueU8+qZz5fgmgGfp77XXRnU5gAXiQzHGjx+mpn4lGUPpPGh/bUX6QXtjL DDRuaQ7eONK2QeZJSCKbsDmxhny3rCMK75MOP8t5Jq44EFYXPUK73z4DXf/VfVXr mptTloHeAVZzA4UcVoJF7fHGarsCrIRF4SOCNHtAfSeS3a5PcoxOhYAd8jIoJk3F 2nSNPUQruzFeDZBm4c5YRigVz0/8Tj71tWCzrdNgGRND+1wvnFAIS6zkNCshDk0W kCzGQHdrw/PlKmrktEVD+GUGg+VcGGUKI0M19WkyZ1tv5UfHL7+8OxJJygwEFivq VsANg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddugeeigeekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertd dtvdejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculgfkoffuohfrngdfuceo ihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenucggtffrrghtthgvrhhnpeffke evudffuddvheejvdefkeelfedtudegfeehjeduheegieduffeggeegveefheenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprdhphh hpsehrfigvtgdrtghordhukhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 22 Jan 2026 10:12:14 -0500 (EST) Message-ID: <004c543c-9d57-4355-b8f5-664e44de31ae@rwec.co.uk> Date: Thu, 22 Jan 2026 15:12:13 +0000 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [VOTE] let construct (Block Scoping) To: internals@lists.php.net References: Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 22/01/2026 09:12, Tim Düsterhus wrote: > Hi > > we just opened the vote on the “let construct (Block Scoping)” RFC > (which was originally proposed as “use construct”, but the keyword > changed as a result of the discussion). I have voted No. I really want block scoping as a feature in PHP, but I do not want this syntax. For those who didn't follow the discussion thread, I will try to summarise my reasons: - I don't think PHP is special enough to break with a strong tradition here. A huge family of languages use roughly the same syntax for variable declarations, even though they have very different details of how they work. That includes C and Java, but also JS and Perl, and even VisualBasic (all ultimately traceable to ALGOL). - Users are likely to be coming from those related languages, particularly JS, and are likely to be confused by how this syntax works. - For instance, they would not expect a comma-separated list to be equivalent to a set of nested blocks, which affects the behaviour of cases like let($a=new Foo, $a=new Bar) - The use cases for combining with "if" or "foreach" are interesting, but the result is confusing - the important control flow keyword ends up in the middle of the line. - For other use cases, requiring an extra block adds noise. For instance, if we ever add auto-capture closures, a JS-style a concise block-scoped declaration would be very useful to avoid accidental capture. PHP itself already has "ALGOL-style" declarations, for "const", "global", and "static". I think adding a "let" or "var" keyword with the same syntax would be more consistent, and more useful. There would be details to work out, but dozens of other languages to learn from. My thanks to Seifeddine and Tim for their work on this, and to Tim in particular for patient and respectful discussion. -- Rowan Tommins [IMSoP]