> ... > >> /** >> * >> */ >> public function set name(string $name) { >> $this->name = htmlentities($name); >> $this->name = strip_tags($this->name); >> } >> >> /** >> * >> */ >> public function get name($name) { >> return $this->name; >> } >> >> Greetings, >> Christian >> > > For whatever it's worth, I think that this syntax fits much better > into PHP than do either of the those in the RFC.
I feel that the downfall of this syntax, is that the get and set methods can easily be scattered at either end of a class definition. With the syntaxes I provided, it is easy to tell which of the methods a property has defined at a quick glance, because everything is in on spot. Additionally, public/private/protected/final/abstract/etc only has to be specified once on the property (but can be specified separately! - see the RFC). This means less to read, and clearer, cleaner syntax. Lastly, I think that grouping the two methods just makes sense, because a property is one conceptual object, not two. Separating the two methods makes as much sense logically as does separating a class definition into two parts. - Dennis -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php