<?php
trait A {
public function helloWorld() {
echo "Ленин жив";
}
}
trait B {
public function helloWorld() {
echo "Цой жив";
}
}
class C {
use A, B {
B::helloWorld insteadof A;
}
}
$w = new C();
$w->helloWorld();
?>