Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101266 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36773 invoked from network); 8 Dec 2017 07:12:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Dec 2017 07:12:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@jhdxr.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=me@jhdxr.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain jhdxr.com designates 52.59.177.22 as permitted sender) X-PHP-List-Original-Sender: me@jhdxr.com X-Host-Fingerprint: 52.59.177.22 smtpbgeu1.qq.com Received: from [52.59.177.22] ([52.59.177.22:56925] helo=smtpbgeu1.qq.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EA/92-11466-F5B3A2A5 for ; Fri, 08 Dec 2017 02:12:43 -0500 X-QQ-mid:Yeas16t1512717141t292t28109 Received: from 90373548D78A4F9A84016F99F658592A (me@jhdxr.com [155.69.149.141]) X-QQ-SSF:00000000000000F0FF1000000000000 To: "'Stephen Reay'" , Cc: References: <91639df6-4fbd-a649-6558-7ae9130020ff@telia.com> <670DE052-934C-4EFE-9B70-C59736EAFAD1@koalephant.com> In-Reply-To: <670DE052-934C-4EFE-9B70-C59736EAFAD1@koalephant.com> Date: Fri, 8 Dec 2017 15:12:19 +0800 Message-ID: <009701d36ff3$e2d25e90$a8771bb0$@jhdxr.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Content-Language: en-us Thread-Index: AQJckwwRCza85XHd5amBBqp6ztYI8QHkFe7iAyTFHpECMLjTxKHs84pg X-QQ-SENDSIZE: 520 Feedback-ID: Yeas:jhdxr.com:qybgforeign:qybgforeign1 X-QQ-Bgrelay: 1 Subject: RE: [PHP-DEV] [RFC] Explicit call-site send-by-ref syntax From: me@jhdxr.com (=?utf-8?b?Q0hVIFpoYW93ZWk=?=) On Friday, December 8, 2017 12:42 PM, "Stephen Rea" < = php-lists@koalephant.com> wrote: >> On 8 Dec 2017, at 08:54, "lists@rhsoft.net" wrote: >>=20 >>=20 >>=20 >>> Am 08.12.2017 um 01:38 schrieb Bj=C3=B6rn Larsson: >>>> Den 2017-12-06 kl. 20:49, skrev Nikita Popov: >>>> Hi internals, >>>>=20 >>>> I'd like propose optional support for explicitly marking=20 >>>> by-reference argument passing at the call-site, in addition to the = declaration-site: >>>>=20 >>>> https://wiki.php.net/rfc/explicit_send_by_ref >>>>=20 >>>> In short, while currently we have >>>>=20 >>>> function byRef(&$ref) {...} >>>> byRef($var); >>>>=20 >>>> this proposal would also allow >>>>=20 >>>> function byRef(&$ref) {...} >>>> byRef(&$var); >>>>=20 >>>> so that the use of by-reference passing is obvious without having = to=20 >>>> consult the function declaration. >>>>=20 >>> I think this proposal has a good point about static analysers, not=20 >>> just about human readability. >>> A good static analyser is very helpful for eg migration projects and = >>> if this proposal benefits that, it's a plus. Also using same syntax=20 >>> for references like in other parts of the language has a value. >>> Now expressing the same thing in two different ways, with or without = >>> & is confusing, so I think one needs to think about if old syntax=20 >>> should be deprecated in 8.0 >>=20 >> to get this consistent that would also require change every line of=20 >> code calling core functions like sort instead of sort($array) as=20 >> sort($array) >>=20 >> i doubt that the benefits could justify the BC break >>=20 >> -- >> PHP Internals - PHP Runtime Development Mailing List To unsubscribe,=20 >> visit: http://www.php.net/unsub.php >>=20 > >I think Rowan's suggestion makes a lot of sense. There's zero bc break = for existing code, but new/updated code can get the benefits of being = specific about how the parameter is used. Agreed, and I think those BC break change will be fine if it targets = 8.0. I know people always argue that it's stupid to break the working = code, but IMHO it's ok for a major version update with good reason.