fix passing arguments to call_user_func_array() on PHP 8

This commit is contained in:
Christian Flothmann 2020-08-21 16:12:43 +02:00
parent 12706c4ff0
commit a55ce7c8bb

View File

@ -86,7 +86,13 @@ class GetAttrNode extends Node
throw new \RuntimeException(sprintf('Unable to call method "%s" of object "%s".', $this->nodes['attribute']->attributes['value'], \get_class($obj)));
}
return \call_user_func_array($toCall, $this->nodes['arguments']->evaluate($functions, $values));
$arguments = $this->nodes['arguments']->evaluate($functions, $values);
if (\PHP_VERSION_ID >= 80000) {
$arguments = array_values($arguments);
}
return \call_user_func_array($toCall, $arguments);
case self::ARRAY_CALL:
$array = $this->nodes['node']->evaluate($functions, $values);