On 22 January 2013 01:08, Clint Priest <cpri...@zerocue.com> wrote: > 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
Brilliant. Thank you. -- Richard Quadling Twitter : @RQuadling EE : http://e-e.com/M_248814.html Zend : http://bit.ly/9O8vFY -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php