On Tue, 9 Apr 2019 at 10:54, Nikita Popov <nikita....@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
>


Thanks for putting this forward, it removes one more WTF from the language.
I think non-associativity is safest, because even if it's rarely desirable,
code may be out there that works accidentally with the current situation.
There's also the risk that someone would get used to it working one way in
PHP 8, and accidentally use it in code that's still deployed on PHP 7.

In both cases, it's better to generate an error and force users to be
explicit than introduce subtle bugs. We can then look at making it
right-associative in PHP 9, because anybody that needs to support 7, 8 and
9 can be explicit, and hopefully not many people will be jumping directly
between 7 and 9.

Regards,
-- 
Rowan Collins
[IMSoP]

Reply via email to