On Tue, Apr 9, 2019 at 4:54 AM Nikita Popov <nikita....@gmail.com> wrote:
> Inspired by Bob's recent RFC for concat precedence, I'd like to propose a > deprecation and removal of the left-associative behavior of ternaries. > Instead, explicit parentheses should be used: > > https://wiki.php.net/rfc/ternary_associativity > > This RFC makes nested ternaries without disambiguating parentheses an error > in PHP 8 -- we might want to consider making them right-associative > instead, which is both useful and matches the behavior of other languages. > > Sorry, but I'm a "No" on this one. It'd be swell if PHP's ternary matched other languages, but it doesn't, and we have 20 years of code in the wild which has accepted that fact and moved on. I don't see the benefit in breaking that code. Advise the use of parentheses and move on. -Sara