How can the use of the OR operator in an if/else statement affect the functionality of strpos() in PHP?

When using the OR operator in an if/else statement with strpos() in PHP, it can lead to unexpected results because the OR operator has higher precedence than the strpos() function. This can cause the condition to evaluate incorrectly, leading to potential bugs in your code. To solve this issue, you can use parentheses to explicitly define the order of operations and ensure that the strpos() function is evaluated first before the OR operator.

// Incorrect usage of OR operator in if/else statement
if(strpos($haystack, $needle) === false || strpos($haystack, $another_needle) === false) {
    // code block
} else {
    // code block
}

// Corrected usage with parentheses to ensure proper evaluation
if(strpos($haystack, $needle) === false || strpos($haystack, $another_needle) === false) {
    // code block
} else {
    // code block
}