Edit report at http://bugs.php.net/bug.php?id=54547&edit=1

 ID:                 54547
 Updated by:         cataphr...@php.net
 Reported by:        peter dot ritt at gmx dot net
 Summary:            wrong equality of string numbers
-Status:             Open
+Status:             Verified
 Type:               Bug
 Package:            Unknown/Other Function
 Operating System:   linux
 PHP Version:        5.3.6
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2011-04-16 20:07:43] peter dot ritt at gmx dot net

Description:
------------
comparison of strings using == shows wrong results when both strings are
numbers (digits) around PHP_MAX_INT;

the same comparison using === works correctly;

tested on 64 bit systems only, affects also PHP 5.3.5

Test script:
---------------
$a = '9223372036854775807';

$b = '9223372036854775808';

if ($a == $b) {

    echo "$a == $b\n";

}

else {

    echo "$a != $b\n";

}

// displays 9223372036854775807 == 9223372036854775808



Expected result:
----------------
should display

9223372036854775807 != 9223372036854775808

Actual result:
--------------
displays

9223372036854775807 == 9223372036854775808


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54547&edit=1

Reply via email to