Re: References in rfc:propertygetsetsyntax
| From: | Richard Quadling | Date: | Tue, 22 Jan 2013 11:09:51 +0000 |
| Subject: | Re: References in rfc:propertygetsetsyntax | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-65072@lists.php.net to get a copy of this message | ||
On 22 January 2013 01:08, Clint Priest <cpriest@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€„
> ¸s¦Ç>Ý¥SFâ¾
>
> 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