priv(); } } class B extends A { } $a = new A(); $b = new B(); foo(); bar(); $a->baz(); $b->baz(); foo(); bar(); $a->baz(); $b->baz();