php.net |  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: m at micheas dot net
New email:
PHP Version: OS:

 

 [2012-06-30 08:43 UTC] m at micheas dot net
Description:
------------
---
From manual page: http://www.php.net/function.number-format#refsect1-
function.number-format-changelog
---
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);



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-30 11:10 UTC] nikic@php.net
Related: https://bugs.php.net/bug.php?id=50696

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] aharvey@php.net
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] aharvey@php.net
-Status: Open +Status: Wont fix
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 22:01:31 2024 UTC