I have a method name that is stored in a column in the DB that looks like this:
customs::nicknames($data)
This is the related class:
class customs extends service {
function __construct() {
parent::__construct();
}
public static function nicknames($data) {
return $data;
}
}
When I call it in this way:
$merge = eval($error['custom'] . ';');
The contents of the $data variable is not returned.
Just to give it a try I tried with echo
and it is correctly returning the array to string conversion php error.
So the variable $data
is read correctly. But why does not it return anything?
If I try to call this method without using eval()
like this:
$merge = customs::nicknames($data);
The $data
is returned correctly.
So what's wrong?
Why eval()
is not able to return the method results? How can I solve this issue?