Re: Class Properties in Interfaces?
| From: | Stanislav Malyshev | Date: | Tue, 29 Apr 2008 17:22:51 +0000 |
| Subject: | Re: Class Properties in Interfaces? | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-37310@lists.php.net to get a copy of this message | ||
Hi!
I understand why Interfaces can't have bodies, but could you explain why Interfaces can't have properties?Interfaces are API descriptions. API is usually seen as composed of functions. Some go even as far as recommending even classes don't have public properties at all :) In any case, whenever you want to write $foo->bar, just write $foo->getBar() and $foo->setBar(), and it'd work :) -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com