Re: semicolon terminator for switch cases
| From: | Claude Pache | Date: | Thu, 26 Mar 2020 21:30:22 +0000 |
| Subject: | Re: semicolon terminator for switch cases | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109362@lists.php.net to get a copy of this message | ||
> Le 26 mars 2020 à 21:49, Benoit SCHILDKNECHT <bensor987@neuf.fr> a écrit :
>
> A semi-colon is terminal. Italways is. "You see this set of instructions? Done.". But
> in this case, itis not. You see the problem?
>
No I don’t see the problem. Inside a switch construct, when you reach the end of an instruction
(or of a set of instructions) that is not (resp. does not end with) a control-flow statement, you
pass to the next one. I’m sure that everybody knows that you have to use an explicit control-flow
statement like “break” or “return” if you want to be “done” before reaching the bottom
of the switch construct.
Or maybe people could misguess that “;” in that context is an odd way to mean “: break;”?
—Claude