== and != check equality by value, and in PHP you can compare different types in which certain values ββare considered equivalent.
For example, "" == 0 evaluates to true , although one is a string and the other is an integer.
=== and !== check type as well as value.
So, "" === 0 will be evaluated to false .
Edit: To add another example of how this "type manipulator" can catch you, try the following:
var_dump("123abc" == 123);
Gives bool(true) !
Ben james
source share