The pit of null and 0 comparison

string '0' is not equal to null, int 0 is equal to null

$a = null;
$b = "0";

if ($a < $b) {
	echo "1";
} else {
	echo "2";
}

// 输出1

 

Guess you like

Origin blog.csdn.net/weixin_38230961/article/details/108141373