By mitchp
via bugs.php.net
Submitted: Jun 22 2012 / 15:08
| Subversion | |
| Written by: Lorna Jane Mitchell | |
| Featured Refcardz: Top Refcardz: | |
| 150+ Refcardz Available · Get them all | |
By mitchp
via bugs.php.net
Submitted: Jun 22 2012 / 15:08
Comments
yakkoh replied ago:
Moreover:
For php younger than 5.3.5 the answer to:
php -r 'print number_format("",0) . "\n";'
is NULL and a message:
PHP Warning: number_format() expects parameter 1 to be double, string given in Command line code on line 1
Now I have tried the floatval function, which return 0 on empty string and casting, which also return 0 on empty string.
I suggest that the 'number_format' function uses floatval on a string, for the sake of consistency.
Note1: Python 3+ does not like empty strings and throws an error.
Note2: Perl, the father of PHP, doesn't care.
Voters For This Link (2)
Voters Against This Link (0)