标签: php naming-conventions
在Kohana code conventions中,它指出使用&&和||“不正确”:
&&
||
除了清晰度之外,使用AND和OR是否有任何好处?
AND
OR
答案 0 :(得分:12)
运算符的真值表是相同的,唯一的区别是优先级:
http://php.net/manual/en/language.operators.logical.php
http://www.php.net/manual/en/language.operators.precedence.php
答案 1 :(得分:0)
请确保您选择采用的任何惯例始终如一。否则,优先级问题将困扰您的代码。