class Bar{
public function test(){
$this->testPublic();
$this->testPrivate();
}
public function testPublic(){
echo "Bar::testPublic\n";
}
private function testPrivate(){
echo "Bar::testPrivate\n";
}
}
class Foo extends Bar{
public function testPublic(){
echo "Foo::testPublic\n";
}
private function testPrivate(){
echo "Foo::testPrivate\n";
}
}
$myFoo = new Foo();
$myFoo->test();
//Foo::testPublic
//Bar::testPrivate
I'm having a lot of trouble understanding this output. Would someone be able to give me a clear succinct explanation of what is going on? I'm learning OOP and wanted to know how to use extensions to override the parent class functions.