FloorDiv (//) should return integer value according to documentation
authorOleg Efimov <efimovov@gmail.com>
Thu, 29 Sep 2011 09:24:03 +0000 (13:24 +0400)
committerOleg Efimov <efimovov@gmail.com>
Thu, 29 Sep 2011 09:24:03 +0000 (13:24 +0400)
lib/Twig/Node/Expression/Binary/FloorDiv.php

index e86b1ea..7fbd055 100644 (file)
@@ -17,9 +17,9 @@ class Twig_Node_Expression_Binary_FloorDiv extends Twig_Node_Expression_Binary
      */
     public function compile(Twig_Compiler $compiler)
     {
-        $compiler->raw('floor(');
+        $compiler->raw('intval(floor(');
         parent::compile($compiler);
-        $compiler->raw(')');
+        $compiler->raw('))');
     }
 
     public function operator(Twig_Compiler $compiler)