php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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
Description:
------------
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:
--------------
equal

Patches

Pull Requests

History

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

.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC