|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-01-29 10:09 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 00:00:01 2025 UTC |
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"