diff --git a/lib/Twig/Template.php b/lib/Twig/Template.php index 0c62018fa..ab3af0c70 100644 --- a/lib/Twig/Template.php +++ b/lib/Twig/Template.php @@ -10,10 +10,6 @@ * file that was distributed with this source code. */ -if (PHP_VERSION_ID >= 50600) { - require_once __DIR__.'/twig_call_method.php'; -} - /** * Default base class for compiled templates. * @@ -593,13 +589,7 @@ abstract class Twig_Template // Some objects throw exceptions when they have __call, and the method we try // to call is not supported. If ignoreStrictCheck is true, we should return null. try { - if (!$arguments) { - $ret = $object->$method(); - } elseif (PHP_VERSION_ID >= 50600) { - $ret = twig_call_method($object, $method, $arguments); - } else { - $ret = call_user_func_array(array($object, $method), $arguments); - } + $ret = $object->$method(...$arguments); } catch (BadMethodCallException $e) { if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) { return; diff --git a/lib/Twig/twig_call_method.php b/lib/Twig/twig_call_method.php deleted file mode 100644 index 652cd82a5..000000000 --- a/lib/Twig/twig_call_method.php +++ /dev/null @@ -1,9 +0,0 @@ -$method(...$arguments); -}