What common syntax errors can lead to unexpected T_IF errors in PHP code?

Common syntax errors that can lead to unexpected T_IF errors in PHP code include missing parentheses around the condition in an if statement, missing semicolons at the end of lines, and missing curly braces to enclose the code block within the if statement. To solve this issue, carefully check the syntax of the if statement, ensuring that all parentheses, semicolons, and curly braces are correctly placed.

// Incorrect code with missing parentheses and curly braces causing T_IF error
if $condition
    echo "Condition is true";
else
    echo "Condition is false";

// Corrected code with proper syntax
if ($condition) {
    echo "Condition is true";
} else {
    echo "Condition is false";
}