Possible Duplicate:
php == vs === operator
I understand the difference between ===, !== vs. ==, != in PHP but I always find myself favouring === and !== but I have no real reason why. In the documentation on PHP.net, there are often ‘warnings’ saying that you should use === to check the return value for some built-in functions. So my question is why should I use the one set of operators over another?
Many thanks :).
Automatic type conversion can lead to unexpected false positives and false negatives if it doesn’t convert the way you (or the developer who has to maintain your code in the future) expect it (and the rules for type conversation are usually complex and vary between languages, so there is plenty of scope for such confusion).
Always use the three character version unless you need type conversation.