From: Operating system: Windows and Freebsd PHP version: Irrelevant Package: Unknown/Other Function Bug Type: Bug Bug description:string is equals a 0 !?
Description: ------------ // tested both in // in windows 7 - php 5.2.12.12 // in freebsd 7 - php 5.3.3 // because 'e' equals zero, zero is false and false is not equal to 'e' var_dump(0 == 'e'); // true var_dump(false == 0); // true var_dump(false == 'e'); // false echo '<hr>'; // this means that when we compare int to string will always be equal? var_dump(0 == "e"); // true var_dump(0 == "Bernardo"); // true what is the meaning of this? I think it should not return true. Test script: --------------- <? var_dump(0 == 'e'); // true ?> Expected result: ---------------- bool(false) Actual result: -------------- bool(true) -- Edit bug report at http://bugs.php.net/bug.php?id=54625&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54625&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54625&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54625&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=54625&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54625&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=54625&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=54625&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=54625&r=needscript Try newer version: http://bugs.php.net/fix.php?id=54625&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=54625&r=support Expected behavior: http://bugs.php.net/fix.php?id=54625&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=54625&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=54625&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=54625&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54625&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=54625&r=dst IIS Stability: http://bugs.php.net/fix.php?id=54625&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=54625&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=54625&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=54625&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=54625&r=mysqlcfg
