What potential pitfalls can occur when using if-else statements in PHP?

One potential pitfall when using if-else statements in PHP is forgetting to include an else block, which can lead to unexpected behavior if none of the conditions are met. To avoid this, always make sure to include an else block as a catch-all for any other scenarios that may arise.

// Example of using if-else statement with a catch-all else block
$number = 10;

if ($number < 5) {
    echo "Number is less than 5";
} elseif ($number < 10) {
    echo "Number is less than 10";
} else {
    echo "Number is 10 or greater";
}