Re: RFC: C-sharp style property get/set syntax for PHP
| From: | Stas Malyshev | Date: | Tue, 30 Nov 2010 13:55:17 +0000 |
| Subject: | Re: RFC: C-sharp style property get/set syntax for PHP | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50729@lists.php.net to get a copy of this message | ||
Hi!
I do not think that properties should make use of a trait-like syntax, as that is not what a property is about. A property is basically a layer of syntactic sugar over a pair of methods. The majority of the time when writing properties, you will not want to re-use them, so I have a hard time seeing many parallels to traits.A side note: in PHP, property actually has four methods, not two - get/set/unset/isset. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227