php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14421 Numeric string comparsion fails
Submitted: 2001-12-11 05:21 UTC Modified: 2001-12-11 12:49 UTC
From: pauli dot ojanen at cencei dot fi Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.0.6 OS: Suse Linux, Apache web server
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pauli dot ojanen at cencei dot fi
New email:
PHP Version: OS:

 

 [2001-12-11 05:21 UTC] pauli dot ojanen at cencei dot fi
<?php
 
// Values are NOT the same and it should print out
// "It worked" but it prints "PHP bugs."
 
if("2000000011211132516" == "2000000011211132521") {
  print("PHP bugs.");
} 
else { 
  print("It worked.");
} 
  
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-11 12:49 UTC] sander@php.net
"2000000011211132516" is converted to a number, and so is "2000000011211132521". PHP can't handle numbers that large and therefor may work incorrect.
Use === to avoid that conversion.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Sep 15 20:01:27 2019 UTC