Is there a way to call a function in a class without using 'call_user_func' and without eval?
here is why I ask:
When I use 'call_user_func' I get the '$this not in context' error:
$this->id = $selectId['id'];
$file = 'score_' . $this->sid . '.php'; //the file with the class
if (@include_once($file)) { //including the file
$scoreClass = 'Score_' . $this->id;
call_user_func($scoreClass .'::selectData', $this->user_id);
}
I can overcome this 'not in context' error calling the function like this: but now my name is not variable.
$this->id = $selectId['id'];
$file = 'score_' . $this->sid . '.php'; //the file with the class
if (@include_once($file)) { //including the file
$test = new Score_98673();
$test->selectData($this->user_id);
}