8000 fix passing arguments to call_user_func_array() on PHP 8 · symfony/symfony@a55ce7c · GitHub
[go: up one dir, main page]

Skip to content

Commit a55ce7c

Browse files
committed
fix passing arguments to call_user_func_array() on PHP 8
1 parent 12706c4 commit a55ce7c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Symfony/Component/ExpressionLanguage/Node/GetAttrNode.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,13 @@ public function evaluate($functions, $values)
8686
throw new \RuntimeException(sprintf('Unable to call method "%s" of object "%s".', $this->nodes['attribute']->attributes['value'], \get_class($obj)));
8787
}
8888

89-
return \call_user_func_array($toCall, $this->nodes['arguments']->evaluate($functions, $values));
89+
$arguments = $this->nodes['arguments']->evaluate($functions, $values);
90+
91+
if (\PHP_VERSION_ID >= 80000) {
92+
$arguments = array_values($arguments);
93+
}
94+
95+
return \call_user_func_array($toCall, $arguments);
9096

9197
case self::ARRAY_CALL:
9298
$array = $this->nodes['node']->evaluate($functions, $values);

0 commit comments

Comments
 (0)
0