Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101262 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16488 invoked from network); 8 Dec 2017 00:38:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Dec 2017 00:38:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=bjorn.x.larsson@telia.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bjorn.x.larsson@telia.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain telia.com designates 81.236.60.154 as permitted sender) X-PHP-List-Original-Sender: bjorn.x.larsson@telia.com X-Host-Fingerprint: 81.236.60.154 v-smtpout1.han.skanova.net Received: from [81.236.60.154] ([81.236.60.154:51023] helo=v-smtpout1.han.skanova.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3D/20-11466-BFED92A5 for ; Thu, 07 Dec 2017 19:38:20 -0500 Received: from [192.168.7.8] ([195.198.188.252]) by cmsmtp with SMTP id N6gBeDim20ynON6gBeB0EX; Fri, 08 Dec 2017 01:38:15 +0100 To: Nikita Popov References: Cc: PHP internals Message-ID: <91639df6-4fbd-a649-6558-7ae9130020ff@telia.com> Date: Fri, 8 Dec 2017 01:38:16 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-CMAE-Envelope: MS4wfAm/JnDzKT6vJ0T6rkyTtpgFb3ZDmqHuwWMil4HDLF1BpXLXK0K8L+SXHFuWpm1OSek/KU8SoPahdCzHmZFVZAd0+VjoEc6w7pfUmgGqJWv1baKSV9NJ kp40rCgIeJssRIUL/ONeuunmwijjF0q5aAYoU/a7d9kf5UkqQ2bT4MKZ5lCSj3ITj7JUNKxJpEubDs1YRGgGpB+EXj+SgNNvi3Dflg/LaEyIPxsGVZc3m7pV Subject: Re: [PHP-DEV] [RFC] Explicit call-site send-by-ref syntax From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) Den 2017-12-06 kl. 20:49, skrev Nikita Popov: > Hi internals, > > I'd like propose optional support for explicitly marking by-reference > argument passing at the call-site, in addition to the declaration-site: > > https://wiki.php.net/rfc/explicit_send_by_ref > > In short, while currently we have > > function byRef(&$ref) {...} > byRef($var); > > this proposal would also allow > > function byRef(&$ref) {...} > byRef(&$var); > > so that the use of by-reference passing is obvious without having to > consult the function declaration. > > Regards, > Nikita > I think this proposal has a good point about static analysers, not 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 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 should be deprecated in 8.0. Has never used PHP 4, so not confused by old PHP 4 syntax but I guess for people on this list the percentage is higher... r//Björn