Yes, as I noted at the end of my explanatory comment, this is the case for PHP 8. The ternary conditional operator became non-associative, resulting in unparenthesized ternaries becoming compile-time errors. It's valid syntax in PHP versions prior to 8.
View all comments
Show parent comment
2
u/bucket3432 Jun 24 '23
Yes, as I noted at the end of my explanatory comment, this is the case for PHP 8. The ternary conditional operator became non-associative, resulting in unparenthesized ternaries becoming compile-time errors. It's valid syntax in PHP versions prior to 8.