|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-11-05 11:40 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Jul 15 12:00:01 2026 UTC |
When placed inside a switch statement located inside a for loop, the continue doesn't work as usual in C: the following code display the following output: <? for ( $i=0; $i<10; $i++ ) { switch ( $i ) { case 5: continue; default: echo "$i<br>"; } echo "Should be printed only if i != 5 and now i == $i<br>"; } ?> //output: 0 Should be printed only if i != 5 and now i == 0 1 Should be printed only if i != 5 and now i == 1 2 Should be printed only if i != 5 and now i == 2 3 Should be printed only if i != 5 and now i == 3 4 Should be printed only if i != 5 and now i == 4 Should be printed only if i != 5 and now i == 5 6 Should be printed only if i != 5 and now i == 6 7 Should be printed only if i != 5 and now i == 7 8 Should be printed only if i != 5 and now i == 8 9 Should be printed only if i != 5 and now i == 9 // End of output The line : Should be printed only if i != 5 and now i == 5 should not appear