Re: [RFC] Change the precedence of the concatenation operator
| From: | Niklas Keller | Date: | Mon, 29 Apr 2019 18:18:36 +0000 |
| Subject: | Re: [RFC] Change the precedence of the concatenation operator | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-105512@lists.php.net to get a copy of this message | ||
Am Mo., 29. Apr. 2019 um 09:03 Uhr schrieb Bob Weinand <bobwei9@hotmail.com>:
>
>
> Am 25.04.2019 um 11:52 schrieb Nikita Popov
> <nikita.ppv@gmail.com<mailto:nikita.ppv@gmail.com>>:
>
> On Thu, Mar 28, 2019 at 2:33 PM Bob Weinand
> <bobwei9@hotmail.com<mailto:bobwei9@hotmail.com>> wrote:
> Hey,
>
> I feel like concatenation having the same precedence than addition and subtraction is promoting
> programmers to make mistakes. Albeit typically easy to catch ones, it is a quality of life change at
> least.
>
> Hence I'm proposing a RFC changing the precedences:
> https://wiki.php.net/rfc/concatenation_precedence
>
> Bob
>
> Similarly to the ternary associativity RFC, I've analyzed the top 2000 composer packages
> and checked whether they would be affected by this change:
> https://gist.github.com/nikic/a4df3e8e18c7955c2c21cf6cdb4cbfaa
>
> The tl;dr is that there were 5 instances where behavior would change per this RFC, and all 5 of
> them are bugs in current code and would be interpreted correctly after this RFC.
>
> Nikita
>
> Thanks for the analysis,
>
> Given the confirmation that the impact is minimal (rather beneficial), I'll add this to
> the RFC and start voting tomorrow.
>
> Bob
Maybe we should have a longer timeframe and deprecate in 8.0 and
change precedence in 9.0, similar to how it might be done with ?:
changing to non-assoc in 8.0 and maybe right-assoc in 9.0 or 10.0?
Should we have a secondary vote for that?
Regards, Niklas