논리 연산자

표 10-6. 논리 연산자

ExampleNameResult
$a and $bAndTRUE if both $a and $b are TRUE.
$a or $bOrTRUE if either $a or $b is TRUE.
$a xor $bXorTRUE if either $a or $b is TRUE, but not both.
! $aNotTRUE if $a is not TRUE.
$a && $bAndTRUE if both $a and $b are TRUE.
$a || $bOrTRUE if either $a or $b is TRUE.

두개의 다른 "and"와 "or" 연산자를 쓰는 이유는 그들이 다른 우선순위를 가지고 있기 때문이다. (연산자 우선순위를 참고)