|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28200 string comparing
Submitted: 2004-04-28 09:51 UTC Modified: 2004-04-28 12:37 UTC
From: mikael dot suvi at trigger dot ee Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.3.5 OS: Linux
Private report: No CVE-ID: None
 [2004-04-28 09:51 UTC] mikael dot suvi at trigger dot ee
By comparing strings that contain only numbers and are longer that certain length give strange results. When using === I get the correct results. Does that mean that when comparing strings one should use ONLY === and not ==.

Reproduce code:
$str =  "1111111111111111111";
$str1 = "1111111111111111112";

if ($str == $str1) print "equal";

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-28 12:37 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 25 09:01:29 2024 UTC