com php-langspec: Continue on switch emits warning: spec/11-statements.md tests/statements/jump/continue.phpt
[email protected] (Nikita Popov) Mon, 10 Sep 2018 11:54:16 +0000
| Newsgroups | php.standards.cvs |
|---|---|
| Message-ID | <[email protected]> |
Commit: b5ca441040e2c6f8c38d3b7373f7c720af4b8f8c=0AAuthor: Nikita Pop= ov <[email protected]> Mon, 10 Sep 2018 13:54:16 +0200=0AParents= : ea03278e7e3d48061ef6744570b8f36b7a20d02c=0ABranches: master=0A=0ALink:= http://git.php.net/?p=3Dphp-langspec.git;a=3Dcommitdiff;h=3Db5ca4410= 40e2c6f8c38d3b7373f7c720af4b8f8c=0A=0ALog:=0AContinue on switch emits warni= ng=0A=0AChanged paths:=0A M spec/11-statements.md=0A M tests/statements= /jump/continue.phpt=0A=0A=0ADiff:=0Adiff --git a/spec/11-statements.md b/sp= ec/11-statements.md=0Aindex a8dfc9e..062a64e 100644=0A--- a/spec/11-stateme= nts.md=0A+++ b/spec/11-statements.md=0A@@ -860,9 +860,11 @@ number `1` and = containing statements having levels increasing by 1.=0A A `continue` statem= ent terminates the execution of one or more enclosing=0A [iteration](#itera= tion-statements) or [`switch`](#the-switch-statement) statements,=0A up to = the specified level. If the statement at the *breakout-level* is an iterati= on statement,=0A-the next iteration (if any) of the next innermost enclosin= g iteration or switch statement is started.=0A+the next iteration (if any) = of the iteration statement is started.=0A If that statement is a `for` stat= ement and it has a *for-end-of-loop*, its=0A-end-of-loop expression group f= or the current iteration is evaluated first. If=0A+end-of-loop expression g= roup for the current iteration is evaluated first. If it=0A+is a `switch` s= tatement, a warning is emitted and the behavior is the same as a=0A+[`break= ` statement](#the-break-statement) at the same *breakout-level*. If=0A *bre= akout-level* is omitted, a level of 1 is assumed.=0A =0A A `continue` state= ment may break out of a construct that is fully=0Adiff --git a/tests/statem= ents/jump/continue.phpt b/tests/statements/jump/continue.phpt=0Aindex 3efcd= 99..040b06e 100644=0A--- a/tests/statements/jump/continue.phpt=0A+++ b/test= s/statements/jump/continue.phpt=0A@@ -85,7 +85,8 @@ for ($i =3D 10; $i <=3D= 40; $i +=3D10)=0A =09echo "\nJust beyond the switch";=0A }=0A echo "\n----= ------\n";=0A---EXPECT--=0A+--EXPECTF--=0A+Warning: "continue" targeting sw= itch is equivalent to "break". Did you mean to use "continue 2"? in %s on l= ine %d=0A 1 is odd=0A 3 is odd=0A 5 is odd=0A