|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-08-01 16:56 UTC] andi@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 13 13:00:01 2026 UTC |
Here is a script: $n = 3; while( --$n ) { echo "Evaluating $n:<br>"; switch( $n ) { case 2: continue; case 1: break; } echo "fell through<br>"; } Here is the output: Evaluating 2: fell through Evaluating 1: fell through Here is what was expected: Evaluating 2: Evaluating 1: fell through Changing "continue" to "continue 2" makes it function correctly. This should not be correct, as a switch is not generally regarded as a looping structure, and PHP does not appear to treat it as one - the continue is simply treated as a break.