<?php
class Foo {
private function FooFunction(){
}
}
class Bar extends Foo {
public function BarFunction(){
$this->FooFunction();
}
}
$foo = new Foo();
$foo->FooFunction(); //Fatal error: Call to private method Foo::FooFunction()
//(Fair enough)
$bar = new Bar();
$bar->BarFunction(); //Fatal error: Call to private method Foo::FooFunction()
//from context 'Bar'
I'm having some difficulty understanding how to properly declare functions in a class which can then be used in an extension of that class
When I instantiate Foo I'd like FooFunction to remain private. However, I do need to be able to call it from within Bar.