#50696 [NEW]: number_format when passed a 0 as first function argument, returns null
| From: | endosquid at endosquid dot com | Date: | Fri, 08 Jan 2010 19:13:41 +0000 |
| Subject: | #50696 [NEW]: number_format when passed a 0 as first function argument, returns null | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-146442@lists.php.net to get a copy of this message | ||
From: endosquid at endosquid dot com
Operating system: Linux 32 bit
PHP version: 5.3.1
PHP Bug Type: Math related
Bug description: number_format when passed a 0 as first function argument, returns null
Description:
------------
php -r 2>/dev/null 'print number_format("",0) . "\n";'
on our old PHP 5.1.6 Solaris 8 box (that we are transitioning off of)
returns 0.
Now, we're testing our code, and we run into this behavior change:
php -r 2>/dev/null 'print number_format("",0) . "\n";'
on our new RHEL5 with 5.3.1 from the REMI repository returns NULL. Is this
the default behavior expected? If so, why did this change happen? If not,
where did we go wrong?
Reproduce code:
---------------
php -r 2>/dev/null 'print number_format("",0) . "\n";'
Expected result:
----------------
We expect to see 0 returned, not NULL.
Actual result:
--------------
NULL is returned.
--
Edit bug report at http://bugs.php.net/?id=50696&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50696&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50696&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50696&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=50696&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50696&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=50696&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=50696&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=50696&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=50696&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=50696&r=support
Expected behavior: http://bugs.php.net/fix.php?id=50696&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=50696&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=50696&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=50696&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50696&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50696&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=50696&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=50696&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=50696&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=50696&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=50696&r=mysqlcfg