Re: How to build a real Trait thing without exclusion and renaming
| From: | Stanislav Malyshev | Date: | Thu, 28 Feb 2008 03:06:34 +0000 |
| Subject: | Re: How to build a real Trait thing without exclusion and renaming | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-35838@lists.php.net to get a copy of this message | ||
Hi!
trait MyDebug { local $counter = 1;IIRC we don't have keyword "local". Why not "private" or "static"?
class MyClock { use MyDebug *; use MyTicks { timeInTicks = inTicks;This looks like code which does assignment. How I am supposed to understand from it that a new method for MyClock API is born? In any case, why you need timeInTicks at all? If you need it public, why not write an accessor? It'd be better OO anyway, since MyClock's clients can't know about MyTicks's details or even its existence. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com