Why does it print out below like it says it does? Why doesn't it
print out just foo's methods?
Thanks.
class Bar
{
public function test() {
$this->testPrivate( );
$this->testPublic() ;
}
public function testPublic() {
echo "Bar::testPubli c\n";
}
private function testPrivate() {
echo "Bar::testPriva te\n";
}
}
class Foo extends Bar
{
public function testPublic() {
echo "Foo::testPubli c\n";
}
private function testPrivate() {
echo "Foo::testPriva te\n";
}
}
$myFoo = new foo();
$myFoo->test(); // Bar::testPrivat e
// Foo::testPublic
Comment