php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50745 INF==INF evals to FALSE
Submitted: 2010-01-14 08:33 UTC Modified: 2010-01-14 10:09 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: alvaro at demogracia dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.3.2RC1 OS: Windows
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: alvaro at demogracia dot com
New email:
PHP Version: OS:

 

 [2010-01-14 08:33 UTC] alvaro at demogracia dot com
Description:
------------
The INF==INF comparison evals to FALSE in 5.3.1 and 5.3.2RC1 Windows releases. It used to be TRUE in previous versions including 5.3.0 and 5.2.11. I've tested it in Windows XP and Windows Server 2008.

It's also FALSE in 5.2.10 under Red Hat Enterprise Linux 5.

The strict comparison INF===INF evals to TRUE in all cases.

Please note I'm referring to the INF numeric constant, not an 'INF' string.

Reproduce code:
---------------
<?php

var_dump(INF==INF);

?>


Expected result:
----------------
bool(true)

Actual result:
--------------
bool(false)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-14 10:09 UTC] jani@php.net
This is because there was bug in handling INF (and NaN) in Windows prior to 5.3.1 which was fixed. And yes, that's the _expected_ result too. You can't compare infinity to infinity.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 17:01:33 2025 UTC