Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129771 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 992DA1A00BC for ; Sun, 18 Jan 2026 10:53:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1768733588; bh=5oGE6BK+uqJekFnOmo/Kza+6pnvf1Lv+MwKjEefXEBE=; h=Date:Subject:To:References:From:In-Reply-To:From; b=Jjn3xrOamPrhdOX1wWtk9GVHBaYjzThnFX8Bc0l8McNYQzewci7sgeYurRumxdnh1 I/oOny1oCvroUD9+6oh+dAl/W3rFEe5TMBlHH+QCflYx4ZplXm57NZIDP9gpA0zH2W bvLyW8/D9G2WA1qVzFiy6Ql8EU0Y0IJO04dgLh+eYJZ2VjuC384FpP4W7GfLpHeI4L OtrAlwkdYx/JvugjKsgprMJ+mPaLa3fHPbYna4DWb9mqz1Y7dVsdnhCeE3j6rjyMLx PV8QRHcSuevMTggUdDLrMWYpCx9R8VUP7oxy1UYYYAKilH6LidzBkoC2MLQhqpo520 gKccnXcwd6lCQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 08DDD180084 for ; Sun, 18 Jan 2026 10:53:07 +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 ; Sun, 18 Jan 2026 10:53:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1768733579; bh=CcuP1Bw3PpPeTlDknTiSbRUupzYtyzckIXgE6w/V1T8=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=RYF1l/3lBFJE0JYr0UwgrdDcJ2bNuwMC5ZBzr62Ydts+uHBRSVu1lAXQyi9yB9exk eB+8hDAeGUtc9AHAnkKKngEJW4oC/UJzX4RgtgO0KVdDj2INkbXA3KkuinEX95JrJC 5hdJ02YAcmViI0NoSmR0HLbjFCw3JEPj/9V8GgRw35+8DnhB6ME/YKFczbBmko9k// t9FoQ0LqUoZLOk5moyLDpyCsMmUixtJ488TbJQWJzGWLrranY0N8AwzYCTxX5YJYSY JEQ1cK64q1VDDqQGAvsutF64/rtXBAwaQj1MnfU6NhaKhtp/F2vyBwPgxRvSiA+ZdC IfQWPh4EGFBtA== Message-ID: <3c3b9831-4e8b-4c6d-8600-45934d005189@bastelstu.be> Date: Sun, 18 Jan 2026 11:52:56 +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> <8cd697c3-5e25-4854-810c-da220da3f6d8@app.fastmail.com> Content-Language: en-US In-Reply-To: <8cd697c3-5e25-4854-810c-da220da3f6d8@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/15/26 17:01, Larry Garfield wrote: > The core point here is that we needed some way to successfully terminate the block early As I asked in my previous email: Why? You state this requirement as if it was an undisputable fact, but I don't see how it is *needed* and no reasoning is given. > `continue` is really just to mirror what switch does with it. If the consensus is to simply disallow `continue` entirely (which is inconsistent with what switch does today), we're OK with that. I don't feel strongly either way, so we're looking for a consensus. What do you mean by “disallow `continue` entirely”? Does this include `continue 2;` targeting a loop or is this just referring to “continue targeting `using()`? > If there's a different keyword than `break` you think would make more sense here, please do suggest it and provide an argument. But "break does the same thing here it does in switch, foreach, and while" seems like a pretty straightforward approach. “break does a different thing here than it does in if, else, try, catch, finally, namespace, and declare” doesn't seem like a straightforward approach to me. To me using() feels much closer to an if() (or try, given the desugaring) than to a loop. As I had mentioned in my email https://news-web.php.net/php.internals/129582, `goto` *is fine*. And `do-while(false)` would also work as a restricted form of “forward goto”. >> With regard to the desugaring listed at the top: Can you please also >> provide the desugaring for the case where no context variable is >> specified for completeness? > > Desugaring at the top? The desugaring is explained about a third of the way down. :-) Is that what you mean? (In the "Implementation" section.) It doesn't make any sense to go into that level of detail in the introduction. Yes, I meant the first code block in the “Implementation” section. To me that felt like the “top” of the RFC. I didn't mean to suggest to move it elsewhere, I requested an example of what: using (new Manager()) without the `=> $var` results in. Best regards Tim Düsterhus