Edit report at https://bugs.php.net/bug.php?id=50696&edit=1
ID: 50696
Comment by: contact at joezimjs dot com
Reported by: endosquid at endosquid dot com
Summary: number_format when passed a 0 as first function
argument, returns null
Status: Wont fix
Type: Bug
Package: Math related
Operating System: Linux 32 bit
PHP Version: 5.3.1
Block user comment: N
Private report: N
New Comment:
I agree with Endosquid. What you did isn't a "bug fix". Whether or not it complies
with your zend_parse_parameters() nonsense is not the point. A function should only return values
that make sense for that function to return. number_format is supposed to return a string of a
number in a specific format. NULL is neither a string nor a number.
However, the documentation does dictate that number_format's first parameter is supposed to be
a float, and it is the programmer's job to supply correct parameters to the functions they use.
If you supply a string when there should be a number, you're doing it wrong.
Sooo, you both fail at your jobs. :D
Previous Comments:
------------------------------------------------------------------------
[2011-08-23 01:41:43] jacob at jacobweber dot com
Fun thread! Anyway, I was wondering if anyone has a complete list of the functions
that changed as a result of this zend_parse_parameters() fix. I don't see anything
specific in the upgrade instructions:
http://www.php.net/manual/en/migration53.incompatible.php
Also, will number_format((float) $x) behave under PHP 5.3.x exactly the same way
that number_format($x) behaved under PHP 5.2.x? Are there any subtle differences?
Thanks.
------------------------------------------------------------------------
[2010-01-08 23:47:19] bjori@php.net
Sir.
This issue was recently brought to my attention.
On behalf of PHP I would like to apologize. I see that now that you have been treated unfairly.
After carefully reviewing this bug report with our board of directors on 4chan, we have come to the
conclusion that your "rusty C skills" should be enough to fix the issue.
I would therefore like to remind you that rasmus@php.net is http://en.wikipedia.org/wiki/Rasmus_lerdorf
Again, I sincerely apologize. We will try to stop fixing bugs in PHP.
------------------------------------------------------------------------
[2010-01-08 23:22:52] endosquid at endosquid dot com
Just look in the mirror, pal.
You need classes on how to listen to others.
------------------------------------------------------------------------
[2010-01-08 23:20:13] rasmus@php.net
Wow, a classic case of how not to treat unpaid volunteers who provide
critical pieces of your money-making infrastructure.
------------------------------------------------------------------------
[2010-01-08 23:05:43] endosquid at endosquid dot com
I get it. Yours is bigger, you've worked better, you are at the cutting edge of everything, and
you have infinite resources to test every new version of every piece of software in your stack. Got
it. I'm shamed and have no options. So, you're going to give a cover-all answer to make
sure that you don't have to do anything. Ok, I get it. I hope no one ever does this to you,
because it makes you lose faith in the product.
We will push forwrd with patching the source. It would appear that the 1194th line in math.c is the
one that needs changing. returning 0 as opposed to returning nothing? I'll edit and compile.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=50696
--
Edit this bug report at https://bugs.php.net/bug.php?id=50696&edit=1