Re: [RFC] Explicit call-site pass-by-reference (again)

From: Date: Thu, 20 Feb 2020 23:50:09 +0000
Subject: Re: [RFC] Explicit call-site pass-by-reference (again)
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-108707@lists.php.net to get a copy of this message
> On Feb 20, 2020, at 9:13 AM, Nikita Popov <nikita.ppv@gmail.com> wrote: > > I'd like to start the discussion on the "explicit call-site > pass-by-reference" RFC again: > https://wiki.php.net/rfc/explicit_send_by_ref > On Feb 20, 2020, at 6:04 PM, Larry Garfield <larry@garfieldtech.com> wrote: > > If $this->data is itself an object, then you have a concern for data manipulation (spooky > action at a distance) even if it's passed by value. Given how much data these days is objects, > and thus the problem exists regardless of whether it's by value or by reference passing, adding > steps to make pass-by-reference harder doesn't seem to help much. > > --Larry Garfield > On Feb 20, 2020, at 6:26 PM, Christian Schneider <cschneid@cschneid.com> wrote: > > +1 > > The whole discussion about being worried about 'malicious' libraries altering your > precious scalar values misses the fact that PHP is not a pure language, there are many ways a > function can have side-effects, Larry pointing out one obvious one. > Speaking of language editions: Trying to solve one obscure case (and one which is easily enough > detectable by statical analysis) by introducing such a big BC break could render a whole edition > ineligible for a software project. So beware, features bundled in one (hypothetical) edition better > not break too many different things at the same time. > > If you don't trust your library code then you're in deep trouble anyway. A huge +1 to Nikita's RFC. A noted -1 to both Larry and Christian's objection. Why? Because perfect should not be the enemy of the significant improvement for specific use-cases unless it can be illustrated that making the improvement disallows future perfection. -Mike

« previous php.internals (#108707) next »