Re: Adding explicit intent for SWITCH/CASE fall through?
| From: | Mike Schinkel | Date: | Sun, 20 Oct 2019 00:44:09 +0000 |
| Subject: | Re: Adding explicit intent for SWITCH/CASE fall through? | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-107583@lists.php.net to get a copy of this message | ||
> On Oct 19, 2019, at 3:21 AM, Kris Craig <kris.craig@gmail.com> wrote:
> If we're going to do this, let's take the opportunity to make it even more
> useful.
Assuming this idea truly does have momentum, I hope we do not get so focused on the
perfect that we postpone the good indefinitely. There is always next
version...
> I love the idea of being able to explicitly define fallthrough
> points in a case.
Can you elaborate on this, with use-cases and syntax examples, please?
> I agree that "continue" is the logically ideal solution, but the BC
> breakage negates that. So I'd have to go with "next", as it's both concise
> and descriptive.
Given A.L.E.C.'s point about BCy, I think next would be much more likely to
conflict with code-in-the-wild than fallthrough.
That said, if we overload continue with an argument of next, that might be
best of both worlds, e.g. continue next;
-Mike