Re: Traits expecting interfaces implicitly leads to expensive runtime checks
| From: | Stefan Marr | Date: | Fri, 10 Dec 2010 17:20:34 +0000 |
| Subject: | Re: Traits expecting interfaces implicitly leads to expensive runtime checks | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50994@lists.php.net to get a copy of this message | ||
Hello Martin:
On 10 Dec 2010, at 18:15, Martin Wernstahl wrote:
> First i have to say that I am not a PHP internals developer, but as a user I
> think it would maybe be better to just let the trait use the implements
> keyword, and "copy" that to the classes utilizing the trait?
> Or does that seem illogical when the trait does not implement all of the
> methods specified by the interface?
Implements sounds misleading to me. Read: trait Foo implements Bar. Sounds like Foo is providing
Bar and not expecting the interface to be there.
But require might be a good keyword to be reused.
Best Regards
Stefan
--
Stefan Marr
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
http://soft.vub.ac.be/~smarr
Phone: +32 2 629 2974
Fax: +32 2 629 3525