Have you been out on the internet the past decade? Do you have a tendency to make extremities of things and trying to stand the needle on its tip?
Have you been out on the internet the past decade? Do you have a tendency to make extremities of things and trying to stand the needle on its tip?
Making extremes? My medical application would fail FDA approval in minutes if ported to PHP precisely because of this issue.
Btw, PHP's behavior doesn't totally make sense to me either. But I'm willing to assume that its users and designers have thought this through and it makes sense for PHP's intended use cases, because I don't know PHP.
Javascript (which most people on HN seem to like) also has similar issues (null vs. undefined, == and === etc). It got so bad that "Javascript: the good parts" had to be written to define a de-facto sane subset of the language. People are actually writing in Coffeescript (in part) to avoid Javascript's pitfalls.
YMMV.
There are actually some decent commercial PHP IDEs, believe it or not. I wouldn't be surprised if some of them are able to Warn on loose equality comparisons. I don't have much direct experience with them though.
By making the constant the expression's lvalue. But they don't have to do this anymore; gcc warns when you accidentally use = instead of == now.