class A
{
private $a;
}
class B extends A
{
function __construct()
{
(new \ReflectionClass($this))->getProperty('a')->setAccessible(true);
echo $this->a;
}
}
(new B());
this should work, altough it triggers an exception: "property a doesnt exists". Many articles says Reflection is the sollution
Aucun commentaire:
Enregistrer un commentaire