5 ms·
"This bug report highlights the problems you run into if you use it for serious work." Indeed. Passing an empty string for a parameter which is expected to be
by martenshinwarts 14y ago
"This bug report highlights the problems you run into if you use it for serious work."
Indeed. Passing an empty string for a parameter which is expected to be a float is SUCH serious work.
"if it breaks your stuff then tough shit because we're a bunch of amateurs."
You say that, but it rather seems like it broke amateur code.
- Draiken 14y agoUnfortunately PHP is consistently inconsistent. It lets people do that, and it won't ever break. Until they "make it right". Sure the guy didn't test the parameter as being empty, but if you pass a string instead of a float, an error should be raised, and that never happened until the fix. That's the big problem with PHP :/
- martenshinwarts 14y ago"Sure the guy didn't test the parameter as being empty, but if you pass a string instead of a float, an error should be raised" Just like you should not pass strings in place of numbers, in accounting software of all things. Why can't just everbody get it absolutely right the first time? Any language that can do anything also allows you to shoot yourself in the foot. And I think that was the case here, brainless programming; PHP hardly pulled out the rug under something reasonable in this case, they simply defined previously undefined behaviour... and when that happens, that always breaks crappy programs that depended on it, no matter in what language they're written. It's the big problem with idiots; PHP has nothing to do with it.
- cube13 14y ago>Just like you should not pass strings in place of numbers, in accounting software of all things. Why can't just everbody get it absolutely right the first time? Because the input is a text box? Text is, after all, the way for people to input data into a computer.
- jdjb 14y agoIt stills shows a lack of rigour on the part of the developer. A simple "empty()" and "is_numeric()" check should be done on any user input expecting a float BEFORE you pass it off to a number formatting function expecting a float.
- soc88 14y agoIn PHP every code is amateur code.
- Produce 14y agoWhile PHP is full of inconsistencies, it's far fetched to make a claim like this. Take a look at Symfony2 and try saying that it's amateur code.