What are common syntax errors in PHP code that can lead to unexpected results?

One common syntax error in PHP code that can lead to unexpected results is missing semicolons at the end of statements. This can cause PHP to interpret multiple lines of code as a single statement, resulting in errors or unexpected behavior. To solve this issue, make sure to add semicolons at the end of each statement in your PHP code.

// Incorrect code without semicolons
$variable1 = 'Hello'
$variable2 = 'World'

// Corrected code with semicolons
$variable1 = 'Hello';
$variable2 = 'World';