PHP 4.0 Bug #6235: Enormous bug with switch and no case

From: Date: Fri, 18 Aug 2000 12:35:50 +0000
Subject: PHP 4.0 Bug #6235: Enormous bug with switch and no case
Groups: php.dev 
Request: Send a blank email to php-dev+get-29398@lists.php.net to get a copy of this message
From: remi@sinfomic.fr Operating system: linux redhat 6.1 PHP version: 4.0.1pl2 PHP Bug Type: Scripting Engine problem Bug description: Enormous bug with switch and no case this doesnt work: <?php for ($i = 0; $i < 5; $i++) { print "<br>value of i = ".$i."\n"; switch ($i) { default: print "<br>PHP is not buggy\n"; } } ?> while this works: <?php for ($i = 0; $i < 5; $i++) { print "<br>value of i = ".$i."\n"; switch ($i) { case 5: print "<br>I Will never go here\n"; break; default: print "<br>PHP is not buggy\n"; } } ?> this syntax works in C and PHP3, not in PHP4.0.1pl2

« previous php.dev (#29398) next »