Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129794 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 4F8CB1A00BC for ; Mon, 19 Jan 2026 21:37:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1768858646; bh=84hDWA1K1Rl5dUEPC1MDrpK/pjyxNlsqmedjqQahMF4=; h=Date:Subject:To:References:From:In-Reply-To:From; b=abILvDj0ApX1Os2jLSlWuOQyggy3JYlgX9Jw4onEB/xO8qYRZK5FuKuec6PHe/NV6 4xCCL3x3FrtxZqCRD0Ucwu4pgK113F/BIIQ/7UvoCIOBHLFxL+81PBQxGsFCaTewQu kN6itLFIfrkXSFc5fs5Opih9Ycmglk+elywB+dyeZBfNeEoSec3e9iBLiMd3cXsT8m qBlo4iFMSCSLSWt1tncXxzlFQ4M9fQtiWSL0NAgXcGQpt7Ym5QfsIgnll19BLJc8u/ wN/nLy/vjBTfuOYam3mtmh+iO4rWQ7bi+pN2IEAHOyWtAnHmJ832PXQXb09IZhpCWL 3aj5/yBSz1OwQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5A78318003B for ; Mon, 19 Jan 2026 21:37:26 +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.6 required=5.0 tests=BAYES_50,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 ; Mon, 19 Jan 2026 21:37:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1768858639; bh=LosxeG2zz3yPZNqHSVDC//RmrQ+ePdsB/aI4At+uo/Y=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=S3TLp78iuCTwvUvYLB4i0wcYaiYVtKJt87LHvAIYmVirIOFOCyaNLZHufqVQXAoc5 kjl3vZQwL1/gB+251tvY168lqlTD57XJEqb3CeQOHT2JYCEnLTb+/RyUKZHiscTaV1 GlVarcimixvNng3vvlKJYxGYRtGa1bmU3mjuYQkHbnoRqS+0PMxbaoGrtn14wdejLg 4yz+TleO7xNB/I5uxOIGvGheVdJ59oPipkYPuzUmWmi38x8eC5FOX9h4ieuLJMfjjA Xl7JJyEmUfBJTzghIZkIUG0OkNaTIDcY9sT5VMpERBUnm2KdmLi9Hi4zZwA1i+Fi9o LPZOHYGD02B1Q== Message-ID: <1f4dd9b4-70d0-404a-b1ec-18f3f5b13375@bastelstu.be> Date: Mon, 19 Jan 2026 22:37:18 +0100 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC] Context Managers To: Larry Garfield , php internals References: <905d9879-70ef-4c87-8578-26519c6d4818@app.fastmail.com> Content-Language: en-US In-Reply-To: <905d9879-70ef-4c87-8578-26519c6d4818@app.fastmail.com> 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 1/13/26 23:19, Larry Garfield wrote: > Once those issues are addressed, I think we're nearly able to take CMs to a vote. (If anyone else wants to weigh in on some other part as well, even if it's just a voice of support/approval, now is the time.) Something I noticed while reviewing the block scoping RFC: Both RFCs come with new OPcodes in the engine. This can have an impact on extensions that work with OPcodes, for example profilers and debuggers. Block scoping already mentioned this in the RFC Impact section, but the context manager RFC does not. For block scoping the two OPcodes are relatively straight-forward assignments which should (hopefully) be easy to take into account for a debugger. For context managers there seems to be more associated logic to set up the scope within the ZEND_INIT_USING OPcode, which might be more troublesome for debuggers to correctly reason about when stepping through the code (e.g. with the $__RETURN_VALUE meta variable or whatever it is called). Perhaps Derick can provide insight here? Looking at that OPcode I'm also seeing the initialization of the `ResourceContextManager` class. In the RFC it is called `ResourceContext` and it is non-final there (final in the implementation). This is an inconsistency that should be fixed. For that one I was also wondering if it is possible to directly initialize it in userland (the constructor seems to be public) and if it will then behave as expected. I assume the answer is yes to both, but it would be useful for the RFC to clarify this. Best regards Tim Düsterhus