From: wolfgang dot wuensch at ww-informatik dot de Operating system: Windows PHP version: 4.3.2 PHP Bug Type: Scripting Engine problem Bug description: String comparison with "if"
Description: ------------ I compare two strings, who are different from each other. The if-Statement gives me a "true". I want a "false". Reproduce code: --------------- $val1="020510010404020301"; $val2="020510010404020302"; if( $val1 == $val2 ) { echo $val1; echo "<br>"; echo $val2; echo "<br>"; echo "is not good"; } else { echo "yeah"; } Expected result: ---------------- go into the "else" Actual result: -------------- go into the "if" Note: var_dump() used with $var1 and $var2 gives me string(18) strcmp() works fine. -- Edit bug report at http://bugs.php.net/?id=25943&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25943&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25943&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=25943&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=25943&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=25943&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=25943&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=25943&r=support Expected behavior: http://bugs.php.net/fix.php?id=25943&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=25943&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=25943&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=25943&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25943&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=25943&r=dst IIS Stability: http://bugs.php.net/fix.php?id=25943&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=25943&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=25943&r=float