File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -860,9 +860,11 @@ number `1` and containing statements having levels increasing by 1.
860
860
A ` continue ` statement terminates the execution of one or more enclosing
861
861
[ iteration] ( #iteration-statements ) or [ ` switch ` ] ( #the-switch-statement ) statements,
862
862
up to the specified level. If the statement at the * breakout-level* is an iteration statement,
863
- the next iteration (if any) of the next innermost enclosing iteration or switch statement is started.
863
+ the next iteration (if any) of the iteration statement is started.
864
864
If that statement is a ` for ` statement and it has a * for-end-of-loop* , its
865
- end-of-loop expression group for the current iteration is evaluated first. If
865
+ end-of-loop expression group for the current iteration is evaluated first. If it
866
+ is a ` switch ` statement, a warning is emitted and the behavior is the same as a
867
+ [ ` break ` statement] ( #the-break-statement ) at the same * breakout-level* . If
866
868
* breakout-level* is omitted, a level of 1 is assumed.
867
869
868
870
A ` continue ` statement may break out of a construct that is fully
Original file line number Diff line number Diff line change @@ -85,7 +85,8 @@ for ($i = 10; $i <= 40; $i +=10)
85
85
echo "\nJust beyond the switch " ;
86
86
}
87
87
echo "\n---------- \n" ;
88
- --EXPECT --
88
+ --EXPECTF --
89
+ Warning: "continue " targeting switch is equivalent to "break " . Did you mean to use "continue 2 " ? in %s on line %d
89
90
1 is odd
90
91
3 is odd
91
92
5 is odd
You can’t perform that action at this time.
0 commit comments