From:             phpbug at bart dot w-wa dot pl
Operating system: Linux
PHP version:      4.3.7
PHP Bug Type:     Variables related
Bug description:  switch odd behaviour with mixed int/string variables

Description:
------------
Due to FU typecasting switch produces unexpected results when one of the
cases is string, but variable passed to switch is int. 
 

Reproduce code:
---------------
$x = 0;
switch($x) {
case 'something': echo 'something'; break;
case 0:           echo 'zero'; break;
default:          echo 'something else';
};


Expected result:
----------------
zero

Actual result:
--------------
something

-- 
Edit bug report at http://bugs.php.net/?id=29155&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29155&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29155&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29155&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29155&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29155&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29155&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29155&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29155&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29155&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29155&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29155&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29155&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29155&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29155&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29155&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29155&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29155&r=float

Reply via email to