Bug #76824 [NEW]: number_format produces different signed result
From: jamesin dot hongkong dot 1 at gmail dot com
Operating system:
PHP version: 7.2.9
Package: *General Issues
Bug Type: Bug
Bug description:number_format produces different signed result
Description:
------------
One of our integration tests failed starting with PHP 7.2+ due to a
different return value from number_format.
## Reproducible example
```
Output for 7.2.0 - 7.3.0beta2
0.00000
Output for 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.28 - 7.1.21
-0.00000
```
https://3v4l.org/WtLF8
Test script:
---------------
print number_format( -0.000000000004566, 5 );
Expected result:
----------------
-0.00000
Actual result:
--------------
0.00000
--
Edit bug report at https://bugs.php.net/bug.php?id=76824&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76824&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76824&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76824&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76824&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76824&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76824&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76824&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76824&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76824&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76824&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76824&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76824&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76824&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76824&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76824&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76824&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76824&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76824&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76824&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76824&r=mysqlcfg
Thread (2 messages)
- jamesin dot hongkong dot 1 at gmail dot com