Re: Trait aliasing syntax suggestions
| From: | Michael Stack | Date: | Thu, 21 Feb 2008 14:49:29 +0000 |
| Subject: | Re: Trait aliasing syntax suggestions | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-35693@lists.php.net to get a copy of this message | ||
Hello,
What about has?
interface context {
/* ... */
}
trait contextA implements context {
/* ... */
}
class A {
has contextA;
has foobar;
}
In my opinion it is similar and descriptive like you having to implement an
interface with implements, extend a class with 'extends' and now you have a
trait with 'has'.
> Do you like "class Foo class Bar" instead of "class Foo extends Bar"?
> Normally PHP uses a descriptive naming scheme, while "class Foo { trait
> XY; }}" would be declarative.