It's because == is a loose comparison and will juggle data types. It will attempt to convert one data type to another before doing a comparison. In this case, the string is being parsed for a number, it finds no number, so it gets converted to the number 0. Hence, the pass.
If you want a strict comparison that compares values AND types, then you need to use ===.
More info can be found from the PHP manual here:
http://www.php.net/manual/en/types.comparisons.php