Re: [RFC] Propety Accessors v1.1
| From: | Leigh | Date: | Tue, 09 Oct 2012 17:19:46 +0000 |
| Subject: | Re: [RFC] Propety Accessors v1.1 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-63307@lists.php.net to get a copy of this message | ||
> RFC Document:
> https://wiki.php.net/rfc/propertygetsetsyntax-as-implemented
public $property {
set { $this->property = ($this->property*2)+$value }
get;
}
How do I reference the property being set from within the function? The way
I have done it in the example will cause recursion? How can I assign to
"self"?
How do I set the default value of $property when the object is created?
Surely I don't have to reverse the set accessors logic and set the inverse
in __construct?