4 ms·
I understand that the bug reporter is in a bad situation but this is definitely an edge case and passing an empty or whatever non-numeric string to a function t
by soulclap 14y ago
I understand that the bug reporter is in a bad situation but this is definitely an edge case and passing an empty or whatever non-numeric string to a function that is clearly meant for formatting numbers doesn't really seem like good style. is_numeric(), is_float() and casts are available for a reason. So I guess the answer is ultimately 'deal with it'.
That said, I don't see this taking 'months' either, they could just write a wrapper function that mimics the old behaviour and their tests should cover it. If their quality control or inner workflows make changes like this take months, I'd expect that upgrading to a new PHP version and the related testing and QA should take them years.
- blantonl 14y agothis is a classic example of "you mess with the bull, you get the horns."
- reitzensteinm 14y agoA wrapper function is absolutely the right way. Instead, he decides to modify the PHP source and recompile it, effectively forcing him to maintain a fork of PHP, as if somehow that magically takes less effort to develop and QA resources to maintain. Wow.
- blantonl 14y agoSpot on. He doesn't want to update his 50+ applications, but he wants to patch PHP and deal with the deployment of that to all the servers that support those 50+ applications. And he admits that he's not a C++ coder. Sounds like a change management nightmare.
- lnguyen 14y agoBut it's only one change.+ + Technically true. The scope will be equivalent to 50+ change tickets. And he'll be able to blame someone else for any issues that result.
- mturmon 14y agoJust goes to show that the issue had become personal, not technical. The complainer was bent on showing Rasmus that his code was wrong (by implementing the change himself), not on fixing the problem in the easiest way.
- chii 14y ago"Instead, he decides to modify the PHP source and recompile it, effectively forcing him to maintain a fork of PHP, as if somehow that magically takes less effort to develop and QA resources to maintain." hehe, exactly the same sort of mentality that lead the person/team to somehow write code that end up depending on obscure parts of the api!
- dekz 14y agoIt's also really bad style for TAX Software. He should be sanity checking all his numeric data, wow.
- evincarofautumn 14y agoOn another site, I would say “TRWTF is using PHP for taxes”. For that, give me a language with very strict numeric types!
- Domenic_S 14y ago+1. I'm the first to walk away from a PHP bash session, but a wise man once said, "the right tool for the right job."