#45712 [NEW]: $something == NaN returns true with PHP 5.3.0, which returns false until 5.2.6
From: for-bugs at hnw dot jp
Operating system: MacOSX
PHP version: 5.3.0alpha1
PHP Bug Type: Variables related
Bug description: $something == NaN returns true with PHP 5.3.0, which returns false until 5.2.6
Description:
------------
There is == operator's problem dealing with NaN(Not a Number) in PHP
5.3.0alpha1. This behavior is different with PHP 5.0.0-5.2.6, so this is
compatibility problem.
Reproduce code:
---------------
<?php
$nan = (-1e300*1e300)/(1e300*1e300); // float(NAN)
var_dump($nan=='');
var_dump($nan==0.5);
var_dump($nan==50);
var_dump($nan=='500');
var_dump($nan=='abc');
var_dump($nan==$nan);
Expected result:
----------------
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
Actual result:
--------------
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
--
Edit bug report at http://bugs.php.net/?id=45712&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45712&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45712&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45712&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45712&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=45712&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45712&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45712&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45712&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45712&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45712&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=45712&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=45712&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45712&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45712&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45712&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45712&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45712&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45712&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45712&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45712&r=mysqlcfg
Thread (10 messages)
- for-bugs at hnw dot jp
- jani@php.net#45712 [Opn->Ctl]: $something == NaN returns true with 5.3, false with 5.2.*
- jani@php.net#45712 [Ctl]: $something == NaN returns true with 5.3, false with 5.2.*
- for-bugs at hnw dot jp#45712 [Ctl]: $something == NaN returns true with 5.3, false with 5.2.*
- tony2001@php.net#45712 [Ctl->Asn]: $something == NaN returns true with 5.3, false with 5.2.*
- tony2001@php.net#45712 [Asn->Csd]: $something == NaN returns true with 5.3, false with 5.2.*
- jwvdveer at gmail dot comBug #45712 [Com]: $something == NaN returns true with 5.3, false with 5.2.*
- philip@php.netBug #45712 [Csd->ReO]: $something == NaN returns true with 5.3, false with 5.2.*
- cmbecker69 at gmx dot deBug #45712 [Com]: $something == NaN returns true with 5.3, false with 5.2.*
- nikic@php.netBug #45712 [ReO->Csd]: $something == NaN returns true with 5.3, false with 5.2.*