|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #62454 change in handling zero length strings.
Submitted: 2012-06-30 08:43 UTC Modified: 2012-07-20 09:09 UTC
From: m at micheas dot net Assigned:
Status: Wont fix Package: Documentation problem
PHP Version: 5.3.14 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
45 - 25 = ?
Subscribe to this entry?

 [2012-06-30 08:43 UTC] m at micheas dot net
From manual page:
In prior to php 5.3 non-numeric input returned 0 it now returns null.

Test script:
/* this returns 0 prior to php 5.3. As of 5.3 it returns Null */
print number_format("",0);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-30 11:10 UTC]

As of PHP 5.3 all functions (minus a few rare exceptions) throw a warning (and return NULL) on invalid parameters. As this is the same for all functions it isn't explicitly documented.

As the number_format case now came up again one could maybe add a note in the changelog or something like that.
 [2012-07-20 09:09 UTC]
General policy is not to fix these. (And yes, given the commit I just made for doc bug #62471, I realise I'm a giant hypocrite saying that.)
 [2012-07-20 09:09 UTC]
-Status: Open +Status: Wont fix
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 22 15:01:28 2024 UTC