I learned that the empty string "", 0 and "0" all mean false in php. I wonder does php take that into account when it comes to comparing equality.
$str = "";
echo ($str == "0") ? "yes" : "no"; // prints "no" (A)
echo ($str == 0) ? "yes" : "no"; // prints "yes" (B)
Line A suggests that php is comparing $str and "0" as if they are all strings, ignoring that they both can mean false. But line B is comparing their "false" interpretation.
So is it the case that php firstly checks if the two values have the same type, if so it checks equality assuming the same type; if not, it uses the boolean meanings of the values (is there type casting involved?)