<?php
trait Foo {
abstract public function doStuff();
public function main() {
$this->doStuff();
}
}
class Bar {
use Foo {
Foo::doStuff as doOtherStuff;
}
public function doStuff() {
var_dump(__FUNCTION__);
}
}
$b = new Bar();
$b->main();
Fatal error: Class Bar contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Bar::doOtherStuff) in /in/vDEP9 on line 11
Process exited with code 255.
Fatal error: Class Bar contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Bar::doStuff) in /in/vDEP9 on line 11
Process exited with code 255.
Fatal error: Class Bar contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Bar::doStuff) in /in/vDEP9 on line 19
Process exited with code 255.
Output for 5.4.0 - 5.4.10
Fatal error: Class Bar contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Bar::doOtherStuff) in /in/vDEP9 on line 19
Process exited with code 255.