|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
41 + 20 = ?
Subscribe to this entry?

 [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-2020 The PHP Group
All rights reserved.
Last updated: Wed Apr 01 02:01:22 2020 UTC