From 71449e8def795c092cd5d8175e59f0f8ef4ffe2a Mon Sep 17 00:00:00 2001 From: Andreas Streichardt Date: Tue, 24 Jan 2012 17:56:32 +0100 Subject: [PATCH] Remove optimization (covered by Optimization VAR_ACCESS anyway) breaks templates implementing their own getContext() --- lib/Twig/Node/Expression/Name.php | 31 ++++++++++--------------------- 1 files changed, 10 insertions(+), 21 deletions(-) diff --git a/lib/Twig/Node/Expression/Name.php b/lib/Twig/Node/Expression/Name.php index 4b8d541..a8d206f 100644 --- a/lib/Twig/Node/Expression/Name.php +++ b/lib/Twig/Node/Expression/Name.php @@ -35,29 +35,18 @@ class Twig_Node_Expression_Name extends Twig_Node_Expression } elseif ($this->isSpecial()) { $compiler->raw($this->specialVars[$name]); } else { - if (version_compare(phpversion(), '5.4.0RC1', '>=') && ($this->getAttribute('ignore_strict_check') || !$compiler->getEnvironment()->isStrictVariables())) { - // PHP 5.4 ternary operator performance was optimized - $compiler - ->raw('(isset($context[') - ->string($name) - ->raw(']) ? $context[') - ->string($name) - ->raw('] : null)') - ; - } else { - $compiler - ->raw('$this->getContext($context, ') - ->string($name) - ; - - if ($this->getAttribute('ignore_strict_check')) { - $compiler->raw(', true'); - } + $compiler + ->raw('$this->getContext($context, ') + ->string($name) + ; - $compiler - ->raw(')') - ; + if ($this->getAttribute('ignore_strict_check')) { + $compiler->raw(', true'); } + + $compiler + ->raw(')') + ; } } -- 1.7.2.5