Re: [RFC] Deprecate left-associative ternary operator
| From: | Björn Larsson | Date: | Wed, 10 Apr 2019 20:44:59 +0000 |
| Subject: | Re: [RFC] Deprecate left-associative ternary operator | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-105223@lists.php.net to get a copy of this message | ||
Den 2019-04-09 kl. 11:54, skrev Nikita Popov:
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 Thanks for bringing this up. I recall it was up for discussion inPHP 7.0, never made it then. Hope it does it now! Should one in the RFC reference this bug report from 2012? - https://bugs.php.net/bug.php?id=61915 r//Björn L