<?php
trait foo {
public function bar() {
echo 'foo->bar', "\n";
}
}
trait baz {
use foo {
foo::bar as foo_bar;
}
public function bar() {
$this->foo_bar();
echo 'baz->bar', "\n";
}
}
class bar {
use baz;
public function call_bar() {
$this->bar();
}
}
$obj=new bar();
$obj->call_bar();
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bar has a deprecated constructor in /in/suuGu on line 25
foo->bar
baz->bar
foo->bar
baz->bar
Fatal error: Trait method bar has not been applied, because there are collisions with other trait methods on bar in /in/suuGu on line 31
Process exited with code 255.