On Wed, Apr 10, 2019 at 1:22 PM Stanislav Malyshev <smalys...@gmail.com> wrote: > > Hi! > > > 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 > > Please, let's not mess with language syntax and require people to > rewrite their code just because suddenly after 20 years of existence in > the language we feel maybe the precedence should be different. I > literally can't think of a single case where it would improve anyone's > life in any substantial way. If you wanted to use parentheses, you can > do it now - you can even have it enforced by code analyzer if you wish > so, in your private code base. But I can easily imagine dealing with > tons of deprecation warnings (which usually break CI unit tests and > wreak general havoc) or even worse, useless errors, in existing code, > which would become broken for no reason but... honestly, I don't even > know how to finish this phrase, I can't even think of a single reason I > could explain to anybody why their code would no longer work in 8.0. > > I understand 8.0 is a good target for breaking things. But that doesn't > mean we have to do it as much as possible. > > And this absolutely doesn't mean we need to get 7.4 to break things (and > yes, deprecation warning is breaking things, in most cases). > -- > Stas Malyshev > smalys...@gmail.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php
We do not consider new warnings, including deprecation notices, as breaking changes. We know that due to error handlers it can have an effect, but it's just part of the process. I disagree with Stas on the value. The precedence is wrong, and I know of a few codebases which had bugs due to this. In every case, the fix was to avoid it altogether. I agree with statement from the RFC: > As left-associative ternaries are almost certainly bugs, the impact of this > change should be minimal. Thanks, Nikita, on putting this together. It's definitely not a "fun" RFC. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php