iLochie
02-23-2010, 07:18 AM
Can anyone tell me how this can be done?
I'm trying to invoke a private function in my class with another private function using the call_user_func function:
call_user_func($this->$replacement_func,$replacement_params);
The call_user_func function should (theoretically) call the private function, but instead is throwing this error:
First argument is expected to be a valid callback
Which obciously means that this is the wrong way of doing this. Does anybody know the proper way of going about this?
EDIT:
Here's how you would do this:
call_user_func(array("classname",$replacement_func),$replacement_params);
Where classname is the name of your class.
I'm trying to invoke a private function in my class with another private function using the call_user_func function:
call_user_func($this->$replacement_func,$replacement_params);
The call_user_func function should (theoretically) call the private function, but instead is throwing this error:
First argument is expected to be a valid callback
Which obciously means that this is the wrong way of doing this. Does anybody know the proper way of going about this?
EDIT:
Here's how you would do this:
call_user_func(array("classname",$replacement_func),$replacement_params);
Where classname is the name of your class.