Re: [RFC] Deprecate left-associative ternary operator
| From: | Nikita Popov | Date: | Mon, 22 Apr 2019 08:09:44 +0000 |
| Subject: | Re: [RFC] Deprecate left-associative ternary operator | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-105328@lists.php.net to get a copy of this message | ||
On Tue, Apr 9, 2019 at 11:54 AM Nikita Popov <nikita.ppv@gmail.com> wrote:
> Hi internals,
> The only objection here came from Gabriel, and I don't think we'll come to
> an agreement.
> 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_The only objection here came
> from
> Gabriel, and I don't think we'll come to an agreement.associativity
> <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.
>
> Regards,
> Nikita
>
Heads up: Plan to start voting tomorrow.
Apart from Bishop, would anyone else prefer to directly go to right
associativity in PHP 8 rather than making it an error? I'm rather partial
to that myself, maybe it can be included as a voting option...
Nikita