On Fri, Dec 10, 2010 at 9:29 AM, Nathan Nobbe <quickshif...@gmail.com> wrote:
> On Fri, Dec 10, 2010 at 10:15 AM, Martin Wernstahl <m4r...@gmail.com> 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?
>>
>
> This is actually in the RFC as a rejected proposal
>
> http://wiki.php.net/rfc/traits#rejected_features
>
> But what I'm talking about is something different.  We're not trying to say
> 'these are the methods implemented in the trait', rather, 'this trait
> expects a class it is used with to be of a certain type or implement a
> certain interface' for the trait to do its job.
>
> -nathan
>

Shouldn't the burden be on the programmer to make sure the trait works
with the class using it rather than on the compiler? If they try to
use a trait that requires methods that don't exist, it will error out
anyway, so it won't be difficult to debug.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to