Re: [RFC] Explicit call-site pass-by-reference (again)
| From: | Rowan Tommins | Date: | Fri, 21 Feb 2020 22:20:21 +0000 |
| Subject: | Re: [RFC] Explicit call-site pass-by-reference (again) | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108715@lists.php.net to get a copy of this message | ||
On 20 February 2020 14:13:58 GMT+00:00, Nikita Popov <nikita.ppv@gmail.com> wrote:
>Hi internals,
>
>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
Hi Nikita,
Thanks for putting the case for this so clearly. My instinctive reaction is still one of frustration
that the pain of removing call-site ampersands was in vain, and I will now be asked to put most of
them back in. It's also relevant that users already find where & should and should not be
used very confusing. There is a potential "PR" cost of this change that should be weighed
against the advantages.
I'm also not very keen on internal functions being able to do things that can't be
replicated on userland, and this RFC adds two: additional behaviour for existing
"prefer-ref" arguments, and new "prefer-value" arguments.
My current opinion is that I'd rather wait for the details of out and inout parameters to be
worked out, and reap higher gains for the same cost. For instance, if preg_match could mark $matches
as "out", I'd be more happy to run in a mode where I needed to add a call-site
keyword.
Regards,
--
Rowan Tommins
[IMSoP]