What are common syntax errors in PHP code that can lead to unexpected behavior or errors like "Parse error: syntax error"?
One common syntax error in PHP code that can lead to a "Parse error: syntax error" is missing or mismatched parentheses, brackets, or curly braces. To solve this issue, carefully check your code for any missing or misplaced opening or closing symbols. Another common mistake is forgetting to end statements with a semicolon, which can also result in a syntax error. Example:
// Incorrect code with missing curly brace
if ($condition) {
echo "Condition is true";
// Missing closing curly brace
```
To fix the issue, add the missing closing curly brace:
```php
// Corrected code with added closing curly brace
if ($condition) {
echo "Condition is true";
}