#44569 [Opn->Fbk]: Evaluation of String as Switch/Case Parameter
| From: | colder@php.net | Date: | Sun, 30 Mar 2008 11:32:36 +0000 |
| Subject: | #44569 [Opn->Fbk]: Evaluation of String as Switch/Case Parameter | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-123777@lists.php.net to get a copy of this message | ||
ID: 44569
Updated by: colder@php.net
Reported By: soenke at brecht dot it
-Status: Open
+Status: Feedback
Bug Type: Scripting Engine problem
Operating System: Unix/Windows
PHP Version: 5.2.5
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.3-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.3-win32-installer-latest.msi
Previous Comments:
------------------------------------------------------------------------
[2008-03-30 11:06:57] soenke at brecht dot it
Description:
------------
Case seems to evaluate only parts of the given case name against the in
case given comparator.
In the given example it aways runs into the first case, comparing only
the first four characters of both strings.
Reproduce code:
---------------
decide("Items");
decide("Item");
decide("some");
function decide ($parameter){
Switch($parameter){
case "Items":
echo "These are all items \n";
break;
case "Item":
echo "A single Item \n";
break;
default:
echo "not listed";
}//end switch
}//end function
Expected result:
----------------
These are all items
A single item
not listed
Actual result:
--------------
These are all items
These are all items
not listed
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44569&edit=1