Bug #66344 [NEW]: Problems of comparison operators

From: Date: Tue, 24 Dec 2013 09:28:37 +0000
Subject: Bug #66344 [NEW]: Problems of comparison operators
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183456@lists.php.net to get a copy of this message
From: set_saman at yahoo dot com Operating system: windows 8 PHP version: Irrelevant Package: *General Issues Bug Type: Bug Bug description:Problems of comparison operators Description: ------------ // output : goodbye !! Test script: --------------- $v = "Colors"; echo $v.'<br>'; $v = settype($v, 'string'); echo $v.'<br>'; if($v === 'hello'){ echo 'hello'; } elseif($v == 'goodbye'){ echo 'goodbye'; } else{ echo 'no'; } // output : goodbye !! --------------------- $v = 95; echo $v.'<br>'; $v = settype($v, 'integer'); echo $v.'<br>'; if($v === 1){ echo 'hello'; } elseif($v == 'goodbye'){ echo 'goodbye'; } else{ echo 'no'; } Expected result: ---------------- I expect Output = no -- Edit bug report at https://bugs.php.net/bug.php?id=66344&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66344&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66344&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66344&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=66344&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=66344&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=66344&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=66344&r=needscript Try newer version: https://bugs.php.net/fix.php?id=66344&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=66344&r=support Expected behavior: https://bugs.php.net/fix.php?id=66344&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=66344&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=66344&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=66344&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66344&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=66344&r=dst IIS Stability: https://bugs.php.net/fix.php?id=66344&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=66344&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=66344&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=66344&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=66344&r=mysqlcfg

« previous php.bugs (#183456) next »