Re: [RFC] Deprecate left-associative ternary operator

From: Date: Wed, 24 Apr 2019 17:25:06 +0000
Subject: Re: [RFC] Deprecate left-associative ternary operator
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-105397@lists.php.net to get a copy of this message
On Tue, Apr 23, 2019 at 3:56 AM Nikita Popov <nikita.ppv@gmail.com> wrote: > Can't say I understand your position here. Don't want to change the > ternary from left-associative to right-associative? I can understand that: > Silent behavior changes are always problematic. This is not what the RFC > proposes though. > > Did the RFC change since introduction? I may have been looking at a stale load of the page (opened it up awhile ago and only just got around to responding). As for what it says atm, I still think it goes too far. the warning in 7.4 I can support, but I'm not a fan of breaking existing code on a feature that's this old. Ratchet up the warning in 8.0 if you'd like, but error is further than I'm willing to go on this one. > 20 years of code in the wild has not "accepted that fact and moved on". If > a left-associative ternary is used, it is almost certainly a bug. If people > use this structure by accident (because it is familiar from other > programming languages), I'd like them to get an error instead of having to > figure out why their obviously correct code is not working or, in the worse > case, just leave behind buggy code. > > I'm on dismal wifi at the moment, else I'd do some searches, but do you have any examples of code in the wild subject to this bug? I agree it's a lousy state, but it's not emergent. -Sara

« previous php.internals (#105397) next »