Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129854 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 A27811ADD31 for ; Thu, 22 Jan 2026 15:38:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1769096299; bh=QepBvZa+VZ06YVLKSJ2Hk7KDPwByJUySj0j3N04ioXk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=CSNZd4CgMWFzPkY8xTvdIwOxPVDJXFUmgplMSjT8lSgtSOgATN+3TywV0V3HZeiuz ubc1UH0B9flCcQoIDfT1XPrXuz9Qg7cH32f3jjGeC6F7GQr4xroZ/6wgvrEJkzO+lz BddkPGPeMoxVk+1sZouoqnSDV60dZdZypAMcDHQzh8ccHBKLA5AJo3fPYrtMPa3kjR UG46kroPpE2Yt9VJ9eUi+vOR3dx3SDjSGOcHrLumjwwPNfirLCP9VYzXh2eYL9Gd0w FbLPmzCbSjea788gazEQv5VmfBO49EWLs8TrBRcuFUJCyiKBiZhBW+xAHbSPin7wvo nxp0TyTjG+2xA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4B4E21805D6 for ; Thu, 22 Jan 2026 15:38:17 +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=1.6 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FORGED_GMAIL_RCVD,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) (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:38:12 +0000 (UTC) Received: by mail-qt1-f196.google.com with SMTP id d75a77b69052e-4ffbea7fdf1so9257311cf.1 for ; Thu, 22 Jan 2026 07:38:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769096287; cv=none; d=google.com; s=arc-20240605; b=ZC1a4FrInh466iY00zZsy5tuWgglkCfIbfA/M7OcJ+UNyr/HYTN1AcfY47oXB/8yvd UC5Ug/Kph6XvC613lTC+H1MdPLdHRon1COjFeFpMUKtcSM3AH97roR9BBhjQd/qXIYU4 sZV9ZiDkxf9/sHQHONCMQz8jxGnuZSovMxUgHOdtAy9+QQcy8qEStLGA1d2g0nNQNXB7 PacklJH52NIdwsKto7KqcMgJE9Q2INz5TAecrUIv76A4/gwE81Lh+uCj2YOYFB/lC2Xq SxS7+sMJixwS/vpvIJ4a+6vFs6pXAL+KbCJmes0KElWuAQW0DN3RswdZ+pZ5YHnLU23I 42FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=QepBvZa+VZ06YVLKSJ2Hk7KDPwByJUySj0j3N04ioXk=; fh=0un1hNQkIQnxRVmSrptHpYePKulyS9pFxhu85Wb7djM=; b=j4TFCs+QZHujxkfQEaoHmYSQf5S5FfPvM0AXUmFcCXa2O1dPkdVUDHFKGePXqI6Vaf 61fSweLPr5I7OiT4f5SoROueRBWnr79GxO2cfccJkinhglle+OJsqnyx4D+N8tQldVyC 9JFopA6ELQvpAz6Yn3KMFONU65j6xsgljYaoWQamz6KHp01krt3o9Z6LQSBmNO9+THmZ JYrWgSyvUiR2Wey6t1hOc4l1wJTmxGeg/alh6homTLLpMJkvW5buCaXarlQwy8iViqre 9p5XOU9VzbbU+7tnlJcJwSipeFZv3Y7sOR+KFYf7TEdNQ2CD8G7iz2GO3dHKsalM2b10 qQdQ==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769096287; x=1769701087; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QepBvZa+VZ06YVLKSJ2Hk7KDPwByJUySj0j3N04ioXk=; b=fqlqpZH68gDpc6km4IgbSbrwFgmXtMI3byt7QukUtQKJApaJPM0+xL2Vr6vE7S/v45 dYFE1Zinxkk/gLCbyxofO+rj49AH/BrHNJQ5lhBJfn8RBQ72nlGqyufyFOyT7sOktAWz 4yNFKE4bCE6BeqqBMEbFBC4G5j3zsri8IwF4LhEfYSzxpZmxzs8OHftX0wn7zz/a2Vy7 3x4SbwwDJbd/vXSBvre0xcZLo7BFkcnPm0/g5uX12C7+2/0MpJRDN4D9er9I25VAgvNs WetnI6DV3vIkEi4x9P5jq/++cnKoTJ85GfBUU18eby/ONTnOi9Flaxxtk4k8nVeVam37 KmrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769096287; x=1769701087; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=QepBvZa+VZ06YVLKSJ2Hk7KDPwByJUySj0j3N04ioXk=; b=KTS6XdYKNCexB6bR6d6tUTYIcTALSLx+mjmf85u0rdOtfPFhrEeR/H5eRWi+VRFOdt Z38hzl5XAZuZOhZLkkpbrATYUnIq1BT4yLYTr993Wni6tIFrabyugtV59sS9wrHsz6TA 3qNk4gjfK7/CdxDAq9SNQwhyOciQMISOIdvmdB3kEBS/jUGstly/PEe06z2NWP96aonq WFzeH5kzDApRqJJ41VM8KbdDtcDrvtAMLKo7jMIkyGwCMcs0JTj2bmj6LzmWxU5Br7Bz 9TyEc+4T3RSs5yAzBe9LMMnMEpORT5ZFjtir2KYgR65kkhEV2lPfLsXOOg4TbmFzG1Xh /W+g== X-Gm-Message-State: AOJu0Yw5aT/EtHZ9ePRHUCDGvTOwIFItcvwfEuoIWwdw7KDIy6OrmrqS 4lF5yVp6r5yWc6Yda3SuoXaEvhBPxk7uC18WVjwtvxCv2274IW9DQqmnHgMfGVDspVl2Onjtjbr 10/Hl7y46mPKex4rZ0KlvQzh6taVWb3pVCHan X-Gm-Gg: AZuq6aI3cj9sEKZ/XApTtj06DoPApuG4Do2n291Jw6xkdYPttU2inqtdUxYpIHKn06Q T4nx08KusYgQgGRkNU7lc2Fj1zY/P64i46YToVXzdJJG5G+6Qr9BDTOr48yAOJf+DebFGrCOCkE i1QyC4jPlt9p30+en90LbP4toS/Eq5/Fj0ilQ6+EAGYmWHpMlKDauI9Q89eMW/v1h4F9itvvPBq ObSp7snnTnz1iff9fvPT6ivAhUeOFGWiTDHMHoAqTQU25Rbi2qD5HHgoHuAS+4lSgcD7iKlZQ+4 zH4k/P6iEgf9xLdLGiaNbpf7dyQr X-Received: by 2002:ac8:5fc3:0:b0:501:4f3d:1469 with SMTP id d75a77b69052e-502a1f0b778mr340032711cf.52.1769096286886; Thu, 22 Jan 2026 07:38:06 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <004c543c-9d57-4355-b8f5-664e44de31ae@rwec.co.uk> In-Reply-To: <004c543c-9d57-4355-b8f5-664e44de31ae@rwec.co.uk> Date: Thu, 22 Jan 2026 12:37:56 -0300 X-Gm-Features: AZwV_QjjOCPC_1nknRTkif32mvz1rFAmktzBwbHfR6FJuIlL_owb7dUST30g4Iw Message-ID: Subject: Re: [PHP-DEV] [VOTE] let construct (Block Scoping) To: "Rowan Tommins [IMSoP]" Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000c0dec20648fbd37a" From: hwapx.dev@gmail.com (HwapX) --000000000000c0dec20648fbd37a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jan 22, 2026, 12:12 Rowan Tommins [IMSoP] wrote: > On 22/01/2026 09:12, Tim D=C3=BCsterhus wrote: > > Hi > > > > we just opened the vote on the =E2=80=9Clet construct (Block Scoping)= =E2=80=9D RFC > > (which was originally proposed as =E2=80=9Cuse construct=E2=80=9D, 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=3Dnew Foo, $a=3Dnew 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] > I agree, the proposed syntax and nested block hell are terrible! The traditional syntax with implicit and invisible nested block are much better, many languages and years of trusting proved that. > --000000000000c0dec20648fbd37a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Jan 22, 2026, 12:12 Rowan Tommin= s [IMSoP] <imsop.php@rwec.co.uk<= /a>> wrote:
On 22/01/2026 09:12,= Tim D=C3=BCsterhus wrote:
> Hi
>
> we just opened the vote on the =E2=80=9Clet construct (Block Scoping)= =E2=80=9D RFC
> (which was originally proposed as =E2=80=9Cuse construct=E2=80=9D, 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=3Dnew Foo, $a=3Dnew Bar)

- The use cases for combining with "if" or "foreach" ar= e 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.<= br>

PHP itself already has "ALGOL-style" declarations, for "cons= t",
"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]



<= div dir=3D"auto">
--000000000000c0dec20648fbd37a--