I'm having some troubles with some object oriented programming in PHP.
I basically have a function within a class, which displays some text:
public function text() { echo 'text'; } Now I want to store the function name in an arra,y so I can reference it later:
$functions = array('text_func' => 'text'); And in an other function I want to call the above function with the Array reference, so I did the following:
public function display() { $this->functions['text_func'](); } The result will be basically:
text(); My question is that, how is it possible to make this function run? (The correct way it should be look like: $this->text()). However I can't do something like this, because it gives me an error:
$this->$this->functions['text_func'](); Any idea or solution for my problem?