|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-04-08 23:22 UTC] ianbara at imap dot cc
Description: ------------ The attached code prints out EQUALS for me. It should not do this. === Does work correctly however. Test script: --------------- <?php $old = "fca4ed9b761ca8ad209293248c2cdb56"; $new = 0; if ($old == $new) echo "EQUALS"; else echo "NOT EQUALS" ?> Expected result: ---------------- NOT EQUALS Actual result: -------------- EQUALS PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 30 08:00:01 2025 UTC |
Consider the below code, which returns "EQUALS, NOT EQUALS". If not a bug exactly, surely this is not optimal behavior for a language. <?php $old_bad = "fca4ed9b761ca8ad209293248c2cdb56"; $old_good = "4ed9b761ca8ad209293248c2cdb56"; $new = 0; if ($old_bad == $new) { echo "EQUALS, "; } else { echo "NOT EQUALS, "; } if ($old_good == $new) { echo "EQUALS\n"; } else { echo "NOT EQUALS\n"; } ?>