PHP 4.0 Bug #7591: continue doesn't work inside switch statement

From: Date: Thu, 02 Nov 2000 14:57:15 +0000
Subject: PHP 4.0 Bug #7591: continue doesn't work inside switch statement
Groups: php.dev 
Request: Send a blank email to php-dev+get-36788@lists.php.net to get a copy of this message
From: joel@azursoft.fr Operating system: linux glibc 2.1 PHP version: 4.0.3pl1 PHP Bug Type: Scripting Engine problem Bug description: continue doesn't work inside switch statement 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 -- Edit Bug report at: http://bugs.php.net/?id=7591&edit=1

« previous php.dev (#36788) next »