Re: References in rfc:propertygetsetsyntax

From: Date: Tue, 22 Jan 2013 01:08:12 +0000
Subject: Re: References in rfc:propertygetsetsyntax
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
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

Thread (3 messages)

« previous php.internals (#65063) next »