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]

Reply via email to