Re: Class Properties in Interfaces?
| From: | Stanislav Malyshev | Date: | Tue, 29 Apr 2008 17:27:01 +0000 |
| Subject: | Re: Class Properties in Interfaces? | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-37311@lists.php.net to get a copy of this message | ||
Hi!
But, when you add the possibility of getters and setters, a property becomes an abstraction. It would make sense that an interface declaresNothing prevents you from having getters and setters as part of the interface :)
Properties in interfaces make no sense now, but if we ever get a structural method of declaring getters and setters, they might make sense.You can easily have it right now: function __get($name) { $name = "__get".ucfirst($name); return $this->$name(); } etc. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com