Hi,

Simas' question yesterday lead me to take a look at the RFC on the wiki and
I have a quick question.

Specifically on the 'Rejected Features' -> 'Interfaces Propagation' section.

So it sounds like implementing an interface directly with a trait has been
shot down, what I wonder about is will it still work if a class implements
an interface and uses a trait which provides the functions in said
interface?

<?php
interface IHello {
  public function sayHello();
}

trait SayHello {
  public function sayHello() {
    echo 'hello world';
  }
}

class MyHelloWorld implements IHello {
  use SayHello;
}

$o = new MyHelloWorld();
var_dump($o instanceof IHello); // bool (true)
?>

An explicit way to leverage traits in the inheritance tree...  Is that
accurate, or will that not work either?

thx,

-nathan

Reply via email to