From a55ce7c8bb70b3de948cb76cee374c9b3e0f05d8 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 21 Aug 2020 16:12:43 +0200 Subject: [PATCH] fix passing arguments to call_user_func_array() on PHP 8 --- .../Component/ExpressionLanguage/Node/GetAttrNode.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/ExpressionLanguage/Node/GetAttrNode.php b/src/Symfony/Component/ExpressionLanguage/Node/GetAttrNode.php index 1cf414aefe..dffe0e30f6 100644 --- a/src/Symfony/Component/ExpressionLanguage/Node/GetAttrNode.php +++ b/src/Symfony/Component/ExpressionLanguage/Node/GetAttrNode.php @@ -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);