Edit report at https://bugs.php.net/bug.php?id=62112&edit=1

 ID:                 62112
 Updated by:         cataphr...@php.net
 Reported by:        lstro...@php.net
 Summary:            Regression in number_format() in PHP 5.4
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            Math related
 Operating System:   Linux
 PHP Version:        5.4.3
-Assigned To:        
+Assigned To:        cataphract
 Block user comment: N
 Private report:     N

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------
[2012-05-22 21:35:45] lstro...@php.net

Sorry, link is broken: https://github.com/php/php-src/pull/87

------------------------------------------------------------------------
[2012-05-22 21:28:07] lstro...@php.net

See this pull request for the proposed fix: https://github.com/php/php-
src/pull/87

------------------------------------------------------------------------
[2012-05-22 20:17:40] lstro...@php.net

Description:
------------
In PHP 5.3.X, passing a null byte as decimal point lead to no decimal point at 
all. This is not so much problematic for userland, as for C extensions. For 
examlpe phpredis uses it internally (see 
https://github.com/nicolasff/phpredis/blob/master/redis.c#L3665) to format a 
number. This worked fine in PHP 5.3, but with PHP 5.4 only the first character 
until the first decimal point is returned.

Test script:
---------------
php -r 'var_dump(number_format(2000.1, 0, ".", "\x00"));'

Expected result:
----------------
string(4) "2000"

Actual result:
--------------
string(1) "2"


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62112&edit=1

Reply via email to