$a = false; $b = false; $c = true;
$z = $a || $b || $c; // get true
$a = false; $b = false; $c = true;
$z = $a or $b or $c; // get false
$a = false; $b = false; $c = true;
$z = ($a or $b or $c); // get true
![]() |
1
jybox 2017-04-18 13:25:39 +08:00 ![]() 优先级不同, or 的优先级比 =(赋值)还低,第二个其实先运行了赋值操作($z = $a )
|
![]() |
2
holyghost 2017-04-18 13:26:28 +08:00
|
![]() |
3
gouchaoer 2017-04-18 13:34:40 +08:00
就 wecenter 在用 OR 吧,别的没看见用这个的
|