What potential pitfalls can be avoided by properly formatting conditional statements in PHP code, as seen in the example provided?

Improperly formatting conditional statements in PHP code can lead to syntax errors, logical errors, or unexpected behavior. To avoid these pitfalls, it's important to use proper syntax, including using the correct comparison operators and enclosing conditions in parentheses when necessary. Example:

// Incorrect formatting of conditional statement
if $x = 10 {
    echo "x is equal to 10";
}

// Correct formatting of conditional statement
if ($x == 10) {
    echo "x is equal to 10";
}