4 ms·
Well, my point is: $str = ''; $str == null; #true $str == false; #true null == false; #true So in the case of PHP, it's not a matter of correc
by nuclear_eclipse 18y ago
Well, my point is:
$str = '';
$str == null; #true
$str == false; #true
null == false; #true
So in the case of PHP, it's not a matter of correctness, simply because of how PHP handles type coercion. 'false' and 'null' both have legal string values that can evaluate as equal to them or each other.