On Tue, Jul 30, 2019 at 11:01 AM Nicolas Grekas < nicolas.grekas+...@gmail.com> wrote:
> Le mar. 30 juil. 2019 à 10:34, Rowan Collins <rowan.coll...@gmail.com> a > écrit : > > > On Tue, 30 Jul 2019 at 07:14, Nicolas Grekas <nicolas.gre...@gmail.com> > > wrote: > > > > > I think enough time has passed since php4's call-by-ref for the syntax > to > > > be > > > reused now. I think it's unfair to call the RFC a reminiscent of > > > call-by-ref BTW. > > > > > > > > > Firstly, please let's stop calling this a "PHP 4" feature. It was fully > > supported right up to 5.2, deprecated in 5.3, and only removed in 5.4. > > > > Secondly, I completely disagree that it's unfair to compare the two. The > > syntax being proposed in this RFC (& at both call-site and > definition-site) > > was supported by versions prior to PHP 5.4. Those versions left it > optional > > at either side, which was certainly a mistake; but it was perfectly > > possible (and probably common) for coding standards to require it in both > > locations. > > > > It might be a good idea to include a more thorough discussion of this > > history in the RFC. > > > > Call-time pass-by-reference is deprecated since PHP 4.3.0 and triggers a > deprecation warning since then: > https://3v4l.org/MFXsJ > > That's since Dec 2002. > Disclaimer: I started using PHP somewhere around PHP 5.2 times and have never encountered call-time pass-by-reference as anything but a historical concern, so I'm finding it somewhat hard to empathize with the associated emotional baggage the issue may have. With that in mind, I don't see an issue with reusing the previous call-time pass-by-ref syntax here. The & at the call-site still means that the value is going to be passed by refrence (or error), so it's not like someone who was around during the call-time pass-by-ref times would misunderstand what the code does based on their prior knowledge. The only concern I see here is the emotional issue: Bringing & back as a call-site annotation is an admission that the original migration of by-ref passing has been badly botched: Yes, you removed those & at the call-site for nothing. Yes, you shouldn't have been forced to do that! Mistakes happen and hindsight is 20/20. But we should own up to those mistakes. Regards, Nikita