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