diff --git a/src/DI/ContainerBuilder.php b/src/DI/ContainerBuilder.php index 9bd5faeb3..563264bf8 100644 --- a/src/DI/ContainerBuilder.php +++ b/src/DI/ContainerBuilder.php @@ -700,7 +700,7 @@ public function formatStatement(Statement $statement) foreach ($this->definitions[$service]->parameters as $k => $v) { $params[] = preg_replace('#\w+\z#', '\$$0', (is_int($k) ? $v : $k)) . (is_int($k) ? '' : ' = ' . PhpHelpers::dump($v)); } - $rm = new \ReflectionFunction(create_function(implode(', ', $params), '')); + $rm = new \ReflectionFunction(eval('return function(' . implode(', ', $params) . ') {};')); $arguments = Helpers::autowireArguments($rm, $arguments, $this); return $this->formatPhp('$this->?(?*)', array(Container::getMethodName($service), $arguments));