RE: [PHP-DEV] Fix incorrect ternary '?' associativity for 7.0?
| From: | Zeev Suraski | Date: | Sun, 14 Dec 2014 13:06:10 +0000 |
| Subject: | RE: [PHP-DEV] Fix incorrect ternary '?' associativity for 7.0? | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-79634@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Andrea Faulds [mailto:ajf@ajf.me]
> Sent: Sunday, December 14, 2014 2:26 PM
> To: George Bond
> Cc: PHP internals
> Subject: Re: [PHP-DEV] Fix incorrect ternary '?' associativity for 7.0?
>
>
> > On 14 Dec 2014, at 12:01, George Bond
> <happy.melon.wiki+gb@gmail.com> wrote:
> >
> > If you wanted an upgrade path that was not Evil (in the sense of not
> > introducing subtle and hard-to-diagnose bugs), could you not change
> > the operator to be *un*associative in PHP7? That would effectively
> > just make concrete the discouragement/deprecation that's already in
> > the documentation, and would produce irritating but very visible
> > errors for anyone still actually using this functionality, as well as
> > making them alter their code in a forward-compatible way. Then if you
> > want to think really long term, plan to implement the 'correct'
> > associativity in the
> > *next* major version.
>
> Hey George,
>
> That sounds like a good approach, actually, although I'm not sure about
later
> fixing the associativity. If we make it non-associative this does break
things,
> but very loudly rather than changing code's behaviour. I think we should
do
> this.
Although my inclination would be not to change anything, I agree that if
we do decide to change it, George's idea is the best approach.
Zeev