ID:               43964
 Updated by:       [EMAIL PROTECTED]
 Reported By:      twinge at magma dot ca
-Status:           Open
+Status:           Bogus
 Bug Type:         Strings related
 Operating System: openSuse 10.3
 PHP Version:      5.2.5
 New Comment:

This is expected, PHP converts numerical string to type integer/float.

var_dump((int) "12345678901234567890123456789012");
var_dump((int) "12345678901234567890123456789011");

int(2147483647)
int(2147483647)


Previous Comments:
------------------------------------------------------------------------

[2008-01-29 09:25:48] twinge at magma dot ca

Description:
------------
If two strings containing numbers are compared using an if statement,
only the first 16 bytes of the string are compared. Any bytes after the
16th byte are ignored in the comparison.

Reproduce code:
---------------
<?PHP

$value1="12345678901234567890123456789012";
$value2="12345678901234567890123456789011";

if ($value1!=$value2){print"Not equal.<br>";}
if ($value1==$value2){print"Equal.<br>";}

var_dump($value1);
print "<br>";
var_dump($value2);
print "<br>";

?>

Expected result:
----------------
Not equal.
string(32) "12345678901234567890123456789012" 
string(32) "12345678901234567890123456789011" 


Actual result:
--------------
Equal.
string(32) "12345678901234567890123456789012" 
string(32) "12345678901234567890123456789011" 



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


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

Reply via email to