How can you troubleshoot a situation where an if statement with an OR condition is not executing as expected in PHP?

If an if statement with an OR condition is not executing as expected in PHP, it could be due to incorrect syntax or logic within the condition. To troubleshoot this issue, double-check the conditions within the if statement to ensure they are evaluating as expected. Additionally, consider using parentheses to explicitly define the order of operations for the conditions.

// Incorrect if statement with OR condition
if ($x == 1 || $y == 2 && $z == 3) {
    // Code block
}

// Corrected if statement with parentheses
if (($x == 1 || $y == 2) && $z == 3) {
    // Code block
}