Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129072 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 8FD9C1A00BC for ; Tue, 4 Nov 2025 14:03:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1762265040; bh=UM8wxogslc5GUT1rX3Ze68Z0+gnbalB0qjjHdRHt1C8=; h=Date:From:To:In-Reply-To:References:Subject:From; b=IKdQ/tr0uYefcg31g00shw5P2FHbkfOQ1eNa4yt9nF3Zz5CFdrNGbopES6689mJLh 3+voXbMp7qQoJ1qzVnR/oAnCf09SSGz5iQkP2myTtUFSZ4VnE3ooL5FixC+c5SrDdD AlMWcfy9Tr0n14oEADY1i571xP+wV03IMenq3J8x5VFvkw9nq7dOwL9iuy7DbBzE6+ ZJMEGjykVEXkZCN+DvGxojyJuodOyw0cy7L7ov2RZKXb4Zx6O4pcj76mqfTbc/l821 OR8+DQ5jo4P9ejCXLWud1euo/RfNsI5XPHsIMtxatIdltVF6G7i/hTpzK+/sJBMi7W eYqvMxaStxClg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A98EE1801DF for ; Tue, 4 Nov 2025 14:03:57 +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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, 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-a4-smtp.messagingengine.com (fout-a4-smtp.messagingengine.com [103.168.172.147]) (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 ; Tue, 4 Nov 2025 14:03:55 +0000 (UTC) Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfout.phl.internal (Postfix) with ESMTP id 16591EC0175 for ; Tue, 4 Nov 2025 09:03:50 -0500 (EST) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-12.internal (MEProxy); Tue, 04 Nov 2025 09:03:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc: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=fm1; t=1762265030; x=1762351430; bh=P3doZYH31q oE8G7dcls4Z+YRVVkJmWg25cMcTxl1aZM=; b=gjiq3LPxkN7dw+0BA5RWJXDjMq KLj0QI2fHxK+hoPdfFbOzvR0KIMmu7y2NrBzhVv41lFX7aHaxcD/mLDr8UcD611f kNlMVme3288GzZr1Yjsy4KClrSnpu8keYVNnPpCJ8i7AUAWN4csD6KP26EjwLf4G YgZmaKDP+ihMmanK7URY8EkFiUcj1BK7sPT//JxT8aqLZAAyWmP6JdnhMg+M6m6V 9TL7685QG+8ATaC0y2+dej+1oYFBvwgClZKefZfybbuRqI2hWhVq1ncjs6AMudSM 5cQJY5bIoLb6w+1mAiP1HRq5LUcVp805FX4bize2XBZYxHJFJn5SgP7KjAgA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm3; t= 1762265030; x=1762351430; bh=P3doZYH31qoE8G7dcls4Z+YRVVkJmWg25cM cTxl1aZM=; b=j1cpnn91DvgTE18uDDQlnGXfmD7fb7eQcuVgjivKKvvIBfmBst5 YWmSpbbCZ/4bOQlaGoXshNHu1S7sZB+9KQECE/dUzWXOeKvOddoYqU3WMvv8H4Xe cbZxnOVtM5U0Mh6wawm/AhtFu/p98IqVGyAIzoFrfO8Hm/iVUHte5BgSk/ifcZcs OIcIckxvuyJMNnGqhRWTyCIV2ui5330MufrD1CY2vpclwhAgEKPx2gN7iIkw5dNW viO3GdiPglZ6MCxJRWtGEMGuQnbVQg0L4jt+1JSgeik9T0ju13yZCM2VmCMOxFth +iXnLypRyIbGCZTCBAwGm5D96M8sOO43lrA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddukeduvdduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefoggffhffvkfgjfhfutgesrgdtreerre dtjeenucfhrhhomhepfdftohgsucfnrghnuggvrhhsfdcuoehrohgssegsohhtthhlvggu rdgtohguvghsqeenucggtffrrghtthgvrhhnpeehieffkeetleejueefjeffueffheevud fgteevfeeijeevfffhhfegueetteffleenucffohhmrghinhepphhhphdrnhgvthdpghhi thhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheprhhosgessghothhtlhgvugdrtghouggvshdpnhgspghrtghpthhtohepuddp mhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtsh drphhhphdrnhgvth X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id B878D182007A; Tue, 4 Nov 2025 09:03:49 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: AZHpvRB0--8k Date: Tue, 04 Nov 2025 15:03:29 +0100 To: internals@lists.php.net Message-ID: <8962da85-e3b0-4c92-a868-5f952d739bbe@app.fastmail.com> In-Reply-To: References: Subject: Re: [PHP-DEV] [RFC][Discussion] use construct (Block Scoping) Content-Type: multipart/alternative; boundary=965064df99384d79ad6c4cb925194ae6 From: rob@bottled.codes ("Rob Landers") --965064df99384d79ad6c4cb925194ae6 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Tue, Nov 4, 2025, at 14:59, Rob Landers wrote: > On Mon, Nov 3, 2025, at 22:46, Seifeddine Gmati wrote: >> Hello internals, >>=20 >> Tim and I would like to open the discussion on our new RFC that we've= been working on: "use construct (Block Scoping)". >>=20 >> We wanted to raise a few initial points: >>=20 >> =E2=80=A2 The RFC proposes the ``use`` keyword. What are your though= ts on a new ``using`` keyword instead, similar to C# or Hack? >>=20 >> =E2=80=A2 How do you feel about the questions raised in the "Open Is= sues" section? >>=20 >> =E2=80=A2 What are your general thoughts on the RFC? >>=20 >> Please find the following resources for your reference: >>=20 >> =E2=80=A2 RFC: https://wiki.php.net/rfc/optin_block_scoping >>=20 >> =E2=80=A2 POC: https://github.com/php/php-src/compare/master...TimWo= lla:php-src:block-scope >>=20 >> Thanks, >>=20 >> Seifeddine Gmati. >>=20 >=20 > Hello, >=20 > One thing that isn't clear with this RFC is what happens to things red= efined in the scope? >=20 > $a =3D 10; >=20 > use ($a =3D 5) { > var_dump($a); > } >=20 > var_dump($a); // unset or 10? >=20 > =E2=80=94 Rob lol, I just saw "open issues" ... so, never mind. I like option B. =E2=80=94 Rob --965064df99384d79ad6c4cb925194ae6 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


On Tue, Nov 4, 2025, at 14:59, Rob Landers wrote:
On Mon, Nov 3, 2025= , at 22:46, Seifeddine Gmati wrote:

Hello internals,

Tim an= d I would like to open the discussion on our new RFC that we've been wor= king on: "use construct (Block Scoping)".

We wanted to raise a few in= itial points:

  • The RFC proposes the `use` ke= yword. What are your thoughts on a new `using` keyword inst= ead, similar to C# or Hack?

  • How do you feel about the questi= ons raised in the "Open Issues" section?

  • What are your gener= al thoughts on the RFC?

Please find the following resources= for your reference:

Thanks,

Seifeddine Gmati.


Hello,

One thing= that isn't clear with this RFC is what happens to things redefined in t= he scope?

$a =3D 10;

u= se ($a =3D 5) {
  var_dump($a);
}
var_dump($a); // unset or 10?

=E2=80=94 Rob

lo= l, I just saw "open issues" ... so, never mind. I like option B.

=E2=80=94 Rob
--965064df99384d79ad6c4cb925194ae6--