Browse code

feature #2249 Remove optimization as it's not compatible with Symfony cache system (fabpot)

This PR was merged into the 1.x branch.

Discussion
----------

Remove optimization as it's not compatible with Symfony cache system

fixes #2243

@nicolas-grekas Instead of fixing Symfony cache system (which will only happen in a new patch release), I propose to revert these changes. It means no optimization for Twig 1.x, but the optimization is the default in Twig 2.0. So, I don't think this is a big deal.

Commits
-------

d64d320 removed optimization as it's not compatible with Symfony cache system

Fabien Potencier authored on 13/11/2016 15:12:56
Showing 2 changed files
... ...
@@ -10,10 +10,6 @@
10 10
  * file that was distributed with this source code.
11 11
  */
12 12
 
13
-if (PHP_VERSION_ID >= 50600) {
14
-    require_once __DIR__.'/twig_call_method.php';
15
-}
16
-
17 13
 /**
18 14
  * Default base class for compiled templates.
19 15
  *
... ...
@@ -642,8 +638,6 @@ abstract class Twig_Template implements Twig_TemplateInterface
642 638
         try {
643 639
             if (!$arguments) {
644 640
                 $ret = $object->$method();
645
-            } elseif (PHP_VERSION_ID >= 50600) {
646
-                $ret = twig_call_method($object, $method, $arguments);
647 641
             } else {
648 642
                 $ret = call_user_func_array(array($object, $method), $arguments);
649 643
             }
650 644
deleted file mode 100644
... ...
@@ -1,9 +0,0 @@
1
-<?php
2
-
3
-/**
4
- * @internal
5
- */
6
-function twig_call_method($object, $method, $arguments)
7
-{
8
-    return $object->$method(...$arguments);
9
-}