标签:实例 false 比较 dump php_eol als var lse echo
<?php
echo ‘0 == false: ‘;
var_dump(0 == false);
echo ‘0 === false: ‘;
var_dump(0 === false);
echo PHP_EOL;
echo ‘0 == null: ‘;
var_dump(0 == null);
echo ‘0 === null: ‘;
var_dump(0 === null);
echo PHP_EOL;
echo ‘false == null: ‘;
var_dump(false == null);
echo ‘false === null: ‘;
var_dump(false === null);
echo PHP_EOL;
echo ‘"0" == false: ‘;
var_dump("0" == false);
echo ‘"0" === false: ‘;
var_dump("0" === false);
echo PHP_EOL;
echo ‘"0" == null: ‘;
var_dump("0" == null);
echo ‘"0" === null: ‘;
var_dump("0" === null);
echo PHP_EOL;
echo ‘"" == false: ‘;
var_dump("" == false);
echo ‘"" === false: ‘;
var_dump("" === false);
echo PHP_EOL;
echo ‘"" == null: ‘;
var_dump("" == null);
echo ‘"" === null: ‘;
var_dump("" === null);
以上实例输出结果为:
0 == false: bool(true)
0 === false: bool(false)
0 == null: bool(true)
0 === null: bool(false)
false == null: bool(true)
false === null: bool(false)
"0" == false: bool(true)
"0" === false: bool(false)
"0" == null: bool(false)
"0" === null: bool(false)
"" == false: bool(true)
"" === false: bool(false)
"" == null: bool(true)
"" === null: bool(false)
文章来自 www.dg-haiyue.cn
标签:实例 false 比较 dump php_eol als var lse echo
原文地址:https://www.cnblogs.com/96net/p/14933372.html