I am trying to create an initialization function that will call several functions in a class, a quick example of the end result is this:
$foo = new bar; $foo->call('funca, do_taxes, initb');
This works fine with the call_user_func function, but what I really want to do is do it inside the class, I donβt know how to do it, a quick example of my inoperative code looks like this:
class bar { public function call($funcs) { $funcarray = explode(', ', $funcs); foreach($funcarray as $func) { call_user_func("$this->$func");
What can I call a dynamic class function?
source share