Are there any potential pitfalls when using multiple logical operators in PHP statements?

When using multiple logical operators in PHP statements, a potential pitfall is the order of operations. To avoid unexpected results, it's important to use parentheses to explicitly define the order in which the logical operators should be evaluated. Example:

// Potential pitfall: unclear order of operations
if ($a && $b || $c && $d) {
    // code block
}

// Solution: use parentheses to explicitly define order of operations
if (($a && $b) || ($c && $d)) {
    // code block
}