ID: 16843 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Variables related Operating System: Red Hat Linux PHP Version: 4.2.0 New Comment:
What makes you think you can put expressions in a case statement? You can't. No bug here. Previous Comments: ------------------------------------------------------------------------ [2002-04-26 03:29:17] [EMAIL PROTECTED] Perhaps you misunderstood my report - what I posted SHOULD echo "filled equals zerofilled equals zero also" but it doesn't. Another example below: $filled = 0; switch($filled){ case $filled == 0: echo "filled equals 0" break; } $filled = 100; switch($filled){ case $filled == 100: echo "filled equals 100" break; } When that is executed, it returns "filled equals 100". It SHOULD have returned "filled equals 0filled equals 100" but it doesn't - the only explanation is a bug in the switch code. This is not a bogus bug report. ------------------------------------------------------------------------ [2002-04-26 03:18:11] [EMAIL PROTECTED] The bug system is not the appropriate forum for asking support questions. For a list of a range of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php ------------------------------------------------------------------------ [2002-04-26 02:42:05] [EMAIL PROTECTED] The following lines of code produce this: "filled equals zero" $filled = 0; if($filled == 0){ echo "filled equals zero"; } switch($filled){ case $filled == 0: echo "filled equals zero also" break; } As far as I can tell, there is no reason why that case isn't satisfied - $filled DOES equal 0, as the if statement proves, yet "filled equals zero also" never appears on the page. However, replacing "case $filled == 0:" with "case 0:" does work. This can only be a bug. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16843&edit=1