All pastes #459106 Raw Edit

Unnamed

public text v1 · immutable
#459106 ·published 2007-04-26 08:17 UTC
rendered paste body
class Bar
{
    public function test() {
        $this->testPrivate();
        $this->testPublic();
    }
                                                                                                                                                             
    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(); // Bar::testPrivate
                // Foo::testPublic