#34503 [Opn->Bgs]: the switch statement doesn't work correct
| From: | tony2001@php.net | Date: | Wed, 14 Sep 2005 21:38:45 +0000 |
| Subject: | #34503 [Opn->Bgs]: the switch statement doesn't work correct | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-85058@lists.php.net to get a copy of this message | ||
ID: 34503
Updated by: tony2001@php.net
Reported By: phpbug at domaincommunication dot de
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: winXP SP1, SuSE Linux 9.1
PHP Version: 4.4.0
New Comment:
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same.
Thank you for your interest in PHP.
See bug #34425
Previous Comments:
------------------------------------------------------------------------
[2005-09-14 23:35:04] phpbug at domaincommunication dot de
Description:
------------
the switch statement doesn't compare the number '0' with strings
correct.
Reproduce code:
---------------
$act = 0;
$var = '';
switch($act){
case "search":
$var = "search"; break;
case 0:
case "0":
case '0':
case false:
default:
$var = "zero";
}
echo $var;
Expected result:
----------------
zero
Actual result:
--------------
search
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34503&edit=1