Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130589 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 33A631A00BC for ; Tue, 7 Apr 2026 22:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1775600886; bh=RC/A19n7SINcR36Y4hgcigM+FG39R59KDfq6TrDY7w4=; h=Date:Subject:To:References:From:In-Reply-To:From; b=GHCahN74/xd6J8qf7eH2LYUR0JMkSYi/EYWCHxZR3qbgQQ7ujj0ozbOvpUoG/dbVX P3GZGakPwVbIIBA3xmXQyM08xjnYAqq27svZ1NoWpQT6e4+OQZumLbBVKwuouPHkik LnDGZBJrjE7cs6BT1jgmT8KDFTc9BJjMwqrKz06PTSrsDXXS4QBzvzM8+OeVunwsUt 3htBshuFtB7hIACc9EGOTsgSDaGzv+pzj1uZpbeRDSCLwUMORCvxYGAL/XnHaAABMm tM/ZSoSWl2QJcPPgXTQgWR7blvJSDmFFGzhMsug7NRgDz4lDDcXpYidMp4ak3SBrCK Yj46XPLJVV+7A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7B85418005A for ; Tue, 7 Apr 2026 22:28:05 +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.1 required=5.0 tests=BAYES_50,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-a7-smtp.messagingengine.com (fout-a7-smtp.messagingengine.com [103.168.172.150]) (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, 7 Apr 2026 22:27:54 +0000 (UTC) Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 10E7EEC046F for ; Tue, 7 Apr 2026 18:27:49 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Tue, 07 Apr 2026 18:27:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; 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=fm2; t=1775600868; x=1775687268; bh=WhpmBR7SSZ evr8NnO/KFLqV1kwaW9BISd3bxeG2LSeU=; b=r7BeHn59bmyQqwWrf9ugtiw2oO GF3szHUWzQR/LL94Ous8a+N88mKuZH6Maa11A0LP4zn6Kk1xYQDGKg5cg8O4Xs48 mJCYlID0Eke52/AI4z7FhjMkNFtgiwJtysFTTZ7pDBg9V8kwCCQ02rv+UcM7tNz0 zNulpcEz4tHUlsRWP7rFNrVnZefOsOAVo6eR6YUMAqlkI3U0WhS26SO4skfZBL1t Nqws1IAon2PngF3Bq7rrr9jogTvoesbenLyqBI+8ckTvyPKD0DD4emqgsbIcExVC tou4CPFouQwpE++vH9BaAV8UpSFZ8gYptMNY89BGAgvnxOkxdyHRUunOcT8g== 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=fm2; t= 1775600868; x=1775687268; bh=WhpmBR7SSZevr8NnO/KFLqV1kwaW9BISd3b xeG2LSeU=; b=Gv/6ye0jgQ+RsJYMOrtClBVdIy4yoJ7c1mBxImR8hPINgidLtOf jQMXWqWjBJYqGqV1124dhgPhNCC50ahJ1pQXK0OAmu+ppUHDCjqfq8r+Q/01YISH Gn2i3OnDN1FZI9pJaVPEo9hZP5+bolK0N2fevir4WmqB4NF8LWKVroXSIEGesRlc 9WfhOkjQnpUtYbTDwqznaW93SJ9HMaaHH9E3XU3MLymQo4RgvnF/2fMSuJMh1Lzu aL4v1PmKmHMk/Iw1zkfm2ct3keUkYPqtR72g0dd2Iee+91d2l5mfvS1liUjTG2xe 1TfbDzYAfQFKrJx/VlHJ8g61TGFXo+0rQdw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddvudekjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurheptgfkffggfgfuvfhfhfgjsegrtderredtvd ejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculgfkoffuohfrngdfuceoihhm shhophdrphhhphesrhifvggtrdgtohdruhhkqeenucggtffrrghtthgvrhhnpeehteelie eigfeuudeiueeiffdvveehudeufeekjeeugffffedtiedtgeettdelteenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprdhphhhpse hrfigvtgdrtghordhukhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhht pdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 7 Apr 2026 18:27:47 -0400 (EDT) Content-Type: multipart/alternative; boundary="------------eL8210RsAUjM80k7IhWedWzC" Message-ID: <0c59c7d4-8748-47ca-a626-179661803b51@rwec.co.uk> Date: Tue, 7 Apr 2026 23:27:46 +0100 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC] Context Managers To: internals@lists.php.net References: <5d96fca3ca5418e6e9e5d8871b26477f@bastelstu.be> <8bf1b0a7-7771-4f81-b92c-49bb019f7f9d@app.fastmail.com> <02dbe23bb5a4e53be7bf2db7506e07b6@bastelstu.be> <841b8e97-9052-4868-badc-1dd1dad0e99a@app.fastmail.com> Content-Language: en-GB In-Reply-To: <841b8e97-9052-4868-badc-1dd1dad0e99a@app.fastmail.com> From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") This is a multi-part message in MIME format. --------------eL8210RsAUjM80k7IhWedWzC Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 07/04/2026 17:20, Larry Garfield wrote: > We've updated the RFC to address the break question (new section), the continue question (which is now a secondary vote) You are still relying on an incorrect explanation of the relationship between "switch" and "continue": > This behavior is due to a quirk of PHP's design, where |switch| is treated as a looping structure, which most languages do not. "continue" is counted for switch statements not because it is "treated as a loop", but because PHP has numbered break and continue targets. Numbering break targets differently from continue targets would be extremely confusing, so they have to target the same list of constructs. There was strong consensus on this point in the previous discussion. I can only see three defensible options: 1) Support neither "break" nor "continue". This would be consistent with "if", "try", etc, which you have used as comparisons in the RFC. 2) Support "break", and have a Warning on "continue". This would be consistent with "switch", and harmless. 3) Support "break", and have an Error on "continue". This would be novel behaviour, but not dangerous. Personally, I'm leaning towards option 1 - the case for "break" feels weak to me. Regards, -- Rowan Tommins [IMSoP] --------------eL8210RsAUjM80k7IhWedWzC Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 07/04/2026 17:20, Larry Garfield wrote:
We've updated the RFC to address the break question (new section), the continue question (which is now a secondary vote)


You are still relying on an incorrect explanation of the relationship between "switch" and "continue":

> This behavior is due to a quirk of PHP's design, where switch is treated as a looping structure, which most languages do not.


"continue" is counted for switch statements not because it is "treated as a loop", but because PHP has numbered break and continue targets. Numbering break targets differently from continue targets would be extremely confusing, so they have to target the same list of constructs.

There was strong consensus on this point in the previous discussion.


I can only see three defensible options:

1) Support neither "break" nor "continue". This would be consistent with "if", "try", etc, which you have used as comparisons in the RFC.

2) Support "break", and have a Warning on "continue". This would be consistent with "switch", and harmless.

3) Support "break", and have an Error on "continue". This would be novel behaviour, but not dangerous.


Personally, I'm leaning towards option 1 - the case for "break" feels weak to me.


Regards,

-- 
Rowan Tommins
[IMSoP]
--------------eL8210RsAUjM80k7IhWedWzC--