You are missing the point in PHP in that case. Because PHP is dynamic scripting language, public properties can be added and removed in the object on the fly. That's why there is isset and unset that works on object properties. Consider ActiveRecord, DataMappers, ORM, etc. They use that 100% to their advantage - I haven't yet seen a model witch defines all the properties in PHP code - mostly it takes table columns from DB and add these properties in dynamic way. That's why it isn't so straight forward of adding properties like you propose.
P.S. By the way, maybe I haven't being doing some really crazy stuff on PHP, but I rarely define getters and setters in my classes that do something except $this->val = $val and return $this->val. Well, honestly I haven't worked on some stuff developed by more that 6 programmers too (Latvia is a small county - no major epic projects at all), but still I think my point is valid. 2010/12/1 <presid...@basnetworks.net>: >>> public property Hours read getHours write setHours; >> >> I actually like that, though I think we should support the whole >> existing semantics, i.e. get/set/isset/unset. And probably keep the >> names, so we don't call the same thing both "read" and "get". > > This doesn't make sense. To call isset() on a property, would be to ask > if the property itself exists. But once defined, a property always exists > (think of methods, for example). > > (Sorry for sending again Stas, I forgot to reply all) > - Dennis > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php