Bug #74974 [NEW]: NAN Comparison
| From: | webmaster at icecub dot nl | Date: | Sat, 22 Jul 2017 22:51:50 +0000 |
| Subject: | Bug #74974 [NEW]: NAN Comparison | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-210210@lists.php.net to get a copy of this message | ||
From: webmaster at icecub dot nl
Operating system:
PHP version: 7.2Git-2017-07-22 (Git)
Package: Math related
Bug Type: Bug
Bug description:NAN Comparison
Description:
------------
NAN Comparison is giving unexpected results since PHP version 5.4.0 up
till the latest 7.2.0beta1. I know NAN comparison should be avoided.
It's just a bug report.
Test script:
---------------
$nan = NAN;
if(0 < NAN){ echo 'TRUE'; } else { echo 'FALSE'; }
echo "\n";
if(0 < $nan){ echo 'TRUE'; } else { echo 'FALSE'; }
Expected result:
----------------
Expected output in example script:
TRUE
TRUE
Actual result:
--------------
Output versions 7.0.0 - 7.2.0beta1:
TRUE
FALSE
Output versions 5.4.0 - 5.6.30, hhvm-3.10.1 - 3.19.0:
FALSE
FALSE
Output versions 4.3.6 - 5.3.29:
TRUE
TRUE
--
Edit bug report at https://bugs.php.net/bug.php?id=74974&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74974&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74974&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74974&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74974&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74974&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74974&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74974&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74974&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74974&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74974&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74974&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74974&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74974&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74974&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74974&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74974&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74974&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74974&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74974&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74974&r=mysqlcfg