[PHP-DEV] PHP 4.0 Bug #7591: continue doesn't work inside switch statement From: joel <email protected>
Date: 11/02/00

From: joel <email protected>
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

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>