Logical Operators
- Double pipes
||are preferred toOR
Incorrect:
if($foo OR $bar) {...}
Correct:
if($foo || $bar) {...}
- Double ampersand
&&is preferred toAND
Incorrect:
if($foo AND $bar)
Correct:
if($foo && $bar)
- No space should precede or proceed an exclamation point
!before a variable when checking for inverse
Incorrect:
if( ! $foo)
Correct:
if(!$foo)