<?php
trait T {
public function myMethod() {
echo 'Hello World!';
}
}
class A {
use T;
}
class B {
use T {
myMethod as private myAlias;
}
}
$a = new A;
$b = new B;
$a->myMethod();
$b->myMethod();
$b->myAlias();
1