I’m reading through code I’ve just been assigned, and amid many case statements is a single, lone break;. It’s not wrapped in any switch statements. It’s just there, and doesn’t seem to have any purpose. I’m new to PHP, is this some advanced code use, or just leftover code?
Here’s the code:
function foo() {
...many for/switch statements (all with closing brackets)...
break;
...other code....
}
Using this test code:
I get as output (PHP 5.3.10 on Windows):
Which means that if you are not getting a fatal error, then it is most likely contained in some structure that it wants to break out of or, as DaveRandom pointed out, that line is never reached.