changed PHP 5.2.6 fix (thanks luniki for the idea)
authorfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Wed, 14 Oct 2009 08:30:47 +0000 (08:30 +0000)
committerfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Wed, 14 Oct 2009 08:30:47 +0000 (08:30 +0000)
git-svn-id: http://svn.twig-project.org/trunk@46 93ef8e89-cb99-4229-a87c-7fa0fa45744b

lib/Twig/Compiler.php

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