|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66898 number_format requests extra parameters while not mandatory
Submitted: 2014-03-13 11:43 UTC Modified: 2014-03-13 17:26 UTC
From: wildewouter at gmail dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.6.0alpha3 OS: Ubuntu 13.10
Private report: No CVE-ID: None
 [2014-03-13 11:43 UTC] wildewouter at gmail dot com
From manual page:

The final three parameters for the number_format function have a default but when only three of the parameters are filled in, the fourth has become mandatory and it returns null (no fatal error)

Test script:

var_dump(number_format((float) 1.6, 1, '.'));

Expected result:
This should output the string 1.6

Actual result:
This outputs NULL


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-03-13 17:26 UTC]
-Status: Open +Status: Not a bug
 [2014-03-13 17:26 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

The very first thing said in the documentation is
> This function accepts either one, two, or four parameters (not three):
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Mar 28 21:03:37 2023 UTC