Comment

Comment by snorkel

Headline of this post is totally false and this is not even a bug in PHP, it's clearly a bug in the poster's code, so Rasmus response is right. If you actually try doing this in PHP you get this:

   print number_format("",0);

   Warning: number_format() expects parameter 1 to be 
   double, string given in Command line code on line 1
So the poster willfully ignored the warning. You can fix this simply by casting the first arg as a numeric type:

   print number_format((int)"",0);
   0
Please, if you're this bad at programming and you willfully ignore warnings, don't file bugs, and please do not take a programming job at some place that does important things like air traffic control, banking, or life support systems.
parent snorkel 14 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton