From f6fe2dcc201c937b347fc78e9ac09ffb3f255346 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 15 Apr 2024 10:22:35 +0200 Subject: [PATCH] Fix compat with PHP 8.4 --- src/Node/Expression/CallExpression.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Node/Expression/CallExpression.php b/src/Node/Expression/CallExpression.php index 5c7326bf4..fd218b007 100644 --- a/src/Node/Expression/CallExpression.php +++ b/src/Node/Expression/CallExpression.php @@ -37,7 +37,7 @@ protected function compileCallable(Compiler $compiler) } else { $compiler->raw(sprintf('$this->env->getRuntime(\'%s\')->%s', $callable[0], $callable[1])); } - } elseif (\is_array($callable) && $callable[0] instanceof ExtensionInterface) { + } elseif (\is_array($callable) && $callable[0] instanceof ExtensionInterface && false === strpos($callable[1], 'closure:')) { $class = \get_class($callable[0]); if (!$compiler->getEnvironment()->hasExtension($class)) { // Compile a non-optimized call to trigger a \Twig\Error\RuntimeError, which cannot be a compile-time error