The original code is this:
$hash_stack = array();
foreach ($values as $key => $val)
{
array_push($hash_stack, $val['tag']);
eval("\$ret[" . implode($hash_stack, "][") . "] = '{$val[value]}';");
array_pop($hash_stack);
}
It works in php5 but not in php7:
I got this error for each item in array:
Notice: Undefined index: . resultObj][result . in /srv/users/...
I tried to fix it with this:
$value = $val['value'];
$implode = implode($hash_stack, "][");
eval("\$ret[" . $implode . "] = '{$value}';");
array_pop($hash_stack);
But it's still getting an error. What am I doing wrong?
I get this error:
Notice: Use of undefined constant resultObj - assumed 'resultObj' in /srv/use