Try it and see? 🙂
class a
{
function foo()
{
echo "It works!!<br>";
}
}
class b extends a
{
function bar()
{
parent::foo();
}
}
class c extends b
{
function foo()
{
echo "Override it for fun!!<br>";
}
function bar()
{
echo $this->foo();
}
}
$b = new b;
$b->bar();
$c = new c;
$c->bar();
I think, in Java terms, super() refers to the class one up in the heirarchy, which is what parent does in PHP.
Hmm odd behaviour in PHP 5 - if you omit the class constructor of a child class, the parent class constructor gets called.