The following example defines a foo class, which constructs a bar class, and stores it as a property $foo->bar. In the bar class, is it possible to reference the ‘false’ parent class, and use it’s functions?
class bar
{
public function test_false_parent()
{
//Is it possible to access foo->display() from here
{unknown code}::display();
}
}
class foo
{
public $bar;
public function __construct()
{
$this->bar = new bar;
}
public function display()
{
echo "in";
}
}
$foo = new foo;
$foo->bar->test_false_parent();
//Equivalent to $foo->display();
Not without a back reference: