I have a base class with a protected method, a trait that makes that method public and an interface that requires that method as public. Boiled down example is this:
<?php
class b
{
protected function method() {echo 'base';}
}
trait t
{
public function method()
{
parent::method();
}
}
interface e
{
public function method();
}
class c extends b implements e
{
use t;
}
$c = new c();
$c->method();
This gives me a fatal error:
Fatal error: Access level to b::method() must be public (as in class e)
(it says class and not interface e, but whatever).
I tried to be explicit with use t {method as public;} but that makes no difference.
If i comment out the implements e bit from class c, i do see "base" printed on the console.
My PHP version is 5.5.9-1ubuntu4.11.