Re:PHP Bug: #50696: number_format when passed a 0, returns null
by kingkilr on Sunday January 10, 2010 @05:55PM
(#1043834)
Equality isn't transitive in PHP :/. Of course, IMO, the real coding horror here is that in an error circumstance no exception is raised.
Re:PHP Bug: #50696: number_format when passed a 0, returns null
by prodigal_erik on Sunday January 10, 2010 @08:26PM
(#1044073)
This. There are dozens of situations where, given instructions that simply don't make sense, PHP arbitrarily picks some half-baked behavior instead of giving an error. So much so that I think the original poster is out of line for even considering tax planning in a language that wants to guess what you might have wanted to happen!
Re:PHP Bug: #50696: number_format when passed a 0, returns null
by joeschmoesky on Wednesday January 13, 2010 @06:01PM
(#1051423)
+1
Re:PHP Bug: #50696: number_format when passed a 0, returns null
by docgnome on Sunday January 10, 2010 @10:40PM
(#1044258)
While I understand (and agree with) the change to try and standardize PHP behavior, I think that in this case the parent comment is the crux of the issue. Seems like returning NULL violates the principle of least surprise to me.
If "" == 0, meaning "" is coerced to 0, shouldn't it coerce to 0 here too?