RE: [PHP-DEV] [PHP-DEV [RFC] Property Accessors v1.2
| From: | Clint Priest | Date: | Tue, 16 Oct 2012 23:45:51 +0000 |
| Subject: | RE: [PHP-DEV] [PHP-DEV [RFC] Property Accessors v1.2 | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-63477@lists.php.net to get a copy of this message | ||
Jesus, this is such a CF. Can I not write understandable English?
read-only and write-only ENFORCE UPON SUBCLASSES that no setter or getter (respectively) can be
defined. That's all they do. There is no currently proposed solution that meets this need.
This "NEED" was pulled from the original RFC that Dennis wrote some 4 years ago. Perhaps
we don't even NEED a solution to this problem.
> -----Original Message-----
> From: Stas Malyshev [mailto:smalyshev@sugarcrm.com]
> Sent: Tuesday, October 16, 2012 5:59 AM
> To: Jazzer Dane
> Cc: Clint Priest; internals@lists.php.net
> Subject: Re: [PHP-DEV] [PHP-DEV [RFC] Property Accessors v1.2
>
> Hi!
>
> > I apologize for my confusing terminology - let me elaborate. There are
> > no special syntaxes. The below code should help clear things up a bit:
> >
> > class MyClass {
> > private $otherProperty;
> > public $property {
> > get() {}; // Does not "have a body", as there is no code between
> > the curly braces.
>
> It does have a body. This body is just default empty method body returning null - which does
> not throw any exceptions and is
> completely indistinguishable from the outside from property being equal to null.
> I'm not sure it's what the intent of *-only variable is, though I guess it is a way
> to hack around it. I wonder however if it can be done
> better.
>
> --
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
> (408)454-6900 ext. 227