fixed context stack for PHP 5.2.6
authorfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Tue, 13 Oct 2009 17:13:49 +0000 (17:13 +0000)
committerfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Tue, 13 Oct 2009 17:13:49 +0000 (17:13 +0000)
git-svn-id: http://svn.twig-project.org/trunk@37 93ef8e89-cb99-4229-a87c-7fa0fa45744b

lib/Twig/Compiler.php

index 552febe..a48df74 100644 (file)
@@ -170,7 +170,8 @@ class Twig_Compiler implements Twig_CompilerInterface
    */
   public function pushContext()
   {
-    $this->write('$context[\'_parent\'] = $context;'."\n");
+    // the $c variable is here to fix a PHP 5.2.6 bug
+    $this->write('$context[\'_parent\'] = $c = $context;'."\n");
 
     return $this;
   }