<?php
trait T {
private function test()
{
echo "a";
}
}
trait T2{
use T;
}
class A {
use T2;
}
class B extends A{
public function f(){
$this->test();
}
}
$a = new B;
$a->f();
Fatal error: Uncaught Error: Call to private method A::test() from scope B in /in/gBJtW:22
Stack trace:
#0 /in/gBJtW(27): B->f()
#1 {main}
thrown in /in/gBJtW on line 22
Process exited with code 255.
Fatal error: Uncaught Error: Call to private method A::test() from context 'B' in /in/gBJtW:22
Stack trace:
#0 /in/gBJtW(27): B->f()
#1 {main}
thrown in /in/gBJtW on line 22
Process exited with code 255.