Re: [RFC] Context Managers

From: Date: Wed, 05 Nov 2025 23:02:54 +0000
Subject: Re: [RFC] Context Managers
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-129099@lists.php.net to get a copy of this message
On 05/11/2025 22:37, Larry Garfield wrote:
break and continue are interesting keywords. (In the "may you live in interesting times" sense.) Sometimes they have the same effect, if a control structure is non-looping. Or they may have different effects in case it is. The main non-looping case is switch, where for reasons that were before my time the decision was made to deprecate continue in favor of just supporting break. However, blocking it entirely is a problem, because that would change where continue 2 would go (as switch would be removed as a "level" that it could go to). It is kind of a mess.
Nikita's original proposal was indeed to ban continue targeting switch: https://wiki.php.net/rfc/continue_on_switch_deprecation That doesn't mean any targets would get re-numbered, it just means that the case which currently raises a Warning would have thrown an Error. It was talked down to a Warning during discussion: https://externals.io/message/102393 That was partly about backwards compatibility, which doesn't apply here, so I personally think either Warning or Error would be fine. -- Rowan Tommins [IMSoP]

« previous php.internals (#129099) next »