Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65063 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9870 invoked from network); 22 Jan 2013 01:08:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jan 2013 01:08:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=cpriest@zerocue.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cpriest@zerocue.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zerocue.com designates 67.200.53.250 as permitted sender) X-PHP-List-Original-Sender: cpriest@zerocue.com X-Host-Fingerprint: 67.200.53.250 mail.zerocue.com Received: from [67.200.53.250] ([67.200.53.250:36886] helo=mail.zerocue.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/F0-02178-586EDF05 for ; Mon, 21 Jan 2013 20:08:22 -0500 Received: from [172.17.0.122] (unknown [70.112.216.188]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.zerocue.com (Postfix) with ESMTPSA id F37BE12037A; Tue, 22 Jan 2013 01:08:18 +0000 (UTC) Message-ID: <50FDE67C.9060804@zerocue.com> Date: Mon, 21 Jan 2013 19:08:12 -0600 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: RQuadling@GMail.com CC: PHP internals References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------000802050803070501040600" Subject: Re: [PHP-DEV] References in rfc:propertygetsetsyntax From: cpriest@zerocue.com (Clint Priest) --------------000802050803070501040600 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/21/2013 12:36 PM, Richard Quadling wrote: > Hello. > > This may have already been covered, so apologies ... > > With https://wiki.php.net/rfc/propertygetsetsyntax-v1.2#references, > the return by reference is handled by the use of &get{}. > > How about pass-by-reference for set{}? It works, it was simply not included in that section, which it now is: Documented in the references section: https://wiki.php.net/rfc/propertygetsetsyntax-v1.2?&#references > Normally, a function definition dictates this. > > But if $value is already passed, a reference to it (&$value) is not > going to be referencing the external variable surely? > > Whilst objects are always passed by reference (I assume this is still > the case for this rfc and I can see no reason why it isn't), and I > think I can see the sort of issues that setting an accessor to a > reference (binding the value of a property in this class to something > external to the class - yeah - just eek!), is this an issue? > > Will users _want_ ... > > set(&$value){ $this->externally_linked_var = $value; } > > > I'm not expecting any changes to anything, just looking for clarification. > > Regards, > > Richard. > -- -Clint --------------000802050803070501040600--