2010/10/15 Andrei Pelinescu-Onciul andrei@iptel.org:
Because "==" works only with arguments of the same type, 0 it's autoconverted to "0". The alternative would be to log an error.
Here are the rules for ==: /* if left is string, eval left & right as string and use string diff. * if left is int eval as int using int diff * if left is undef, look at right and convert to right type */
Hi, IMHO it's important not to "imitate" unexpected comparissions as they occur in the "great" PHP language:
http://www.otton.org/2008/08/06/stupid-php-tricks-true-false-comparison/