Bug #77389 [NEW]: NAN is not correctly defined in binary representation on Windows
| From: | fghamsary at v3d dot fr | Date: | Mon, 31 Dec 2018 12:48:56 +0000 |
| Subject: | Bug #77389 [NEW]: NAN is not correctly defined in binary representation on Windows | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-218706@lists.php.net to get a copy of this message | ||
From: fghamsary at v3d dot fr
Operating system: Windows
PHP version: 7.2.13
Package: *General Issues
Bug Type: Bug
Bug description:NAN is not correctly defined in binary representation on Windows
Description:
------------
I tested this code with different versions of php 5.6, 7.1 and 7.2 and
it's the same with all.
PHP 7.2.13 (cli) (built: Dec 5 2018 07:19:53) ( NTS MSVC15 (Visual C++
2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
PHP 7.2.6 (cli) (built: May 23 2018 20:29:37) ( NTS MSVC15 (Visual C++
2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
PHP 5.6.36 (cli) (built: Apr 25 2018 16:45:32)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
PHP 7.1.18 (cli) (built: May 24 2018 17:54:03) ( NTS MSVC14 (Visual C++
2015) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
Test script:
---------------
function printBytes($bytes) {
foreach (str_split($bytes) as $b)
printf('%02x ', ord($b));
echo "\n";
}
printBytes(pack('d', (double)NAN));
printBytes(pack('f', (float)NAN));
Expected result:
----------------
00 00 00 00 00 00 f8 7f
00 00 c0 7f
Actual result:
--------------
00 00 00 00 00 00 f8 ff
00 00 c0 ff
--
Edit bug report at https://bugs.php.net/bug.php?id=77389&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77389&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77389&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77389&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77389&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77389&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77389&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77389&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77389&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77389&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77389&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77389&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77389&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77389&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77389&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77389&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77389&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77389&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77389&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77389&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77389&r=mysqlcfg