Ownsight

标题: PHP 运算优先级 [打印本页]

作者: craft? ? 时间: 2014-10-3 16:04
标题: PHP 运算优先级
&& || and or 区别 以及 运算优先级

$p = 6 or 0;

var_dump($p);//int(6)


$p = 6 || 0;

var_dump($p);//bool(true)


$p = 6 and 0;

var_dump($p); //int(6)??


$p = 6 && 0;

var_dump($p); //bool(false)







欢迎光临 Ownsight (http://bbs.ownsight.net/) Powered by Discuz! X3.2