On Tue, Apr 9, 2019 at 5: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.
>

I'd support mandatory disambiguation, though I feel we should go all in and
introduce a ternary with right associativity.

See also Bug 61915[1], which suggests leaving ? left and introducing ?? for
right. Personally I don't see any benefit to keeping a ternary with left
associativity.

[1]: https://bugs.php.net/bug.php?id=61915

Reply via email to