Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129404 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 186081A00BC for ; Sun, 23 Nov 2025 14:29:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1763908182; bh=jOdnRMAHZ+F50NwnSeo1P7V9e4LIY2bZOb6VWJ6Xl4E=; h=Date:Subject:To:References:From:In-Reply-To:From; b=kRTEutsxjHnjXgVxLlgjLRKxIEZQAMLoW3TebNJuPCzWeM8KFt+0rkx8Qj9UU12uu 2A960Y+sww9AonhFGCWTgvPzKf5VKj+ASOWD/t6MpQcvCvDNEHxEvpQ10P+N4+IjQ7 2CwfP1lguZXFILVUqmiB3oHTibd47BwmsLa2uZ1heFaAPluewlClTKbi/fM+hTFV6X BIWmsQev6uPPEVtT2YfVf6Yjkg41VhQw1N0Mqfpx6BHbKqDbwkcOpvTNgFXFS48nV1 VsZ0mn1l/JaVoxTlC/IMLhY8K3VLyrBIIeGFbVGJitP1fTvM+IDbAstlvgf/b4394o xKBH9m/fyn+qw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EB7B718003F for ; Sun, 23 Nov 2025 14:29:41 +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.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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 ; Sun, 23 Nov 2025 14:29:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1763908175; bh=CIg2i6oUvhck09PPe90fq+6ag6wm/gHK4KH289z6AD0=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=DtZU2VK2EJP4F/gxABF2cVugnKYq2SS/yhykdR2xd65CZwPAVyW16R4+2WzaQ7aO7 kH7YjuiPGDu/ctpDhvN1Aqdvs80NHuoMHBjqyIRMAqSsEvus2X0udfwoXrVDw35O1P 09Sd1I6dVlSL/zeZ0zXV2cmey3sSBYUUlgvFOKeGy3F2SeKh3gO/bbueDgXKBD6VJ2 /PMrgxP2zF5oY+/AJe6OhLJj4hbCDGPndhdvBwhBE74QjrKcu0VWjTc0Dxy/mmvDXv bwqVxB2aDQyNqgDcynWN7ZmMmKzMMvFZHMF4hrmZ3Q4LrBYuZR80lYISIdI4FPxUvJ Aq8wG8SHqlAkw== Message-ID: <99421ea8-b7ef-4049-aa74-31e8433309a8@bastelstu.be> Date: Sun, 23 Nov 2025 15:29:34 +0100 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC][Discussion] use construct (Block Scoping) To: Seifeddine Gmati , internals@lists.php.net References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi On 11/3/25 22:46, Seifeddine Gmati wrote: > Please find the following resources for your reference: > > - > > RFC: https://wiki.php.net/rfc/optin_block_scoping > - > > POC: > https://github.com/php/php-src/compare/master...TimWolla:php-src:block-scope To also pull it into the top-level: - We adjusted the keyword from `use()` to `let()`. This has a small BC impact that we explained in the corresponding section. - We refined the entire RFC text to better explain the (design) choices, the focus, to add examples and other clarification. - Since the initial version - but previously announced - the construct will now reset variables to their original value. - And with the latest implementation, there are two new OPcodes that simplify the implementation greatly, but that extensions working with OPcodes need to learn about. The implementation should be up to date with the latest changes. Best regards Tim Düsterhus