|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: mikael dot suvi at trigger dot ee
New email:
PHP Version: OS:


 [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-2022 The PHP Group
All rights reserved.
Last updated: Wed Nov 30 04:05:54 2022 UTC