Re: [RFC] Deprecate left-associative ternary operator
| From: | Gabriel O | Date: | Tue, 09 Apr 2019 11:36:35 +0000 |
| Subject: | Re: [RFC] Deprecate left-associative ternary operator | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-105172@lists.php.net to get a copy of this message | ||
Hello, I am interested to know if this affects behaviour of following code:
putenv($this->colSize ? 'COLUMNS' : 'COLUMNS='.$this->colSize);
> On 9. Apr 2019, at 11:54, Nikita Popov <nikita.ppv@gmail.com> wrote:
>
> Hi internals,
>
> 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.
>
> Regards,
> Nikita