From aa72c5c1ec7d2564e71c276b98deefca5f67dae5 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Fri, 24 Feb 2017 21:24:01 +0100 Subject: [PATCH] ContainerBuilder: create_function() replaced with eval() --- src/DI/ContainerBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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));