What are common pitfalls when using if/else constructs in PHP?

One common pitfall when using if/else constructs in PHP is forgetting to include the opening and closing curly braces for the code block within the if or else statement. This can lead to unexpected behavior and errors in your code. To avoid this, always remember to use curly braces even if the code block contains only one line of code.

// Incorrect way without curly braces
if ($condition)
    echo "Condition is true";
else
    echo "Condition is false";

// Correct way with curly braces
if ($condition) {
    echo "Condition is true";
} else {
    echo "Condition is false";
}