|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-11-21 18:10 UTC] aharvey@php.net
-Status: Open
+Status: Not a bug
[2014-11-21 18:10 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 15:00:02 2026 UTC |
Description: ------------ We're seeing issues with number_format and strange behaviour. It seems to be rounding off / exceeding some kind of _undocumented_ limit ? (related bug: 62792, but the response there is irrelevant since the PHP_INT_MAX isnt even reached in some cases and still the error persists? And before you go 'floating points and limited percision: this is an int, not a float... :) ) Test script: --------------- <?php echo PHP_INT_MAX.PHP_EOL; echo number_format(PHP_INT_MAX, 0, '', '').PHP_EOL; // ? echo '4'.PHP_EOL; echo number_format(4, 0, '', '').PHP_EOL; // as expected echo '23372036854775807'.PHP_EOL; echo number_format('23372036854775807', 0, '', '').PHP_EOL; // still errors echo '3372036854775807'.PHP_EOL; echo number_format('3372036854775807', 0, '', '').PHP_EOL; // yeah! the same results :) Expected result: ---------------- 9223372036854775807 9223372036854775807 4 4 23372036854775807 23372036854775807 3372036854775807 3372036854775807 Actual result: -------------- 9223372036854775807 9223372036854775808 4 4 23372036854775807 23372036854775808 3372036854775807 3372036854775807