Are there any potential drawbacks or limitations to using the ternary operator for conditional assignment in PHP?

One potential drawback of using the ternary operator for conditional assignment in PHP is that it can make the code less readable, especially when nested ternary operators are used. To improve readability, consider using if-else statements instead for complex conditions.

// Using if-else statements for conditional assignment instead of nested ternary operators
$score = 85;
$grade = '';

if ($score >= 90) {
    $grade = 'A';
} elseif ($score >= 80) {
    $grade = 'B';
} elseif ($score >= 70) {
    $grade = 'C';
} else {
    $grade = 'D';
}

echo $grade;