Description

Category: Bug

The break construct allows developers to step out of multiple nesting level of loops, by specifying the optional argument. Providing break with a variable as this argument may change the flow of the code in unexpected ways, and should be avoided.

Example

Dangerous break $foo;
Alternative if ($foo==1) {
    break;
} else if (
$foo=2) {
    break
2;
} else {
    die(
"Unexpected error");
}