From 68ec644936634aa8d83cf72ebaf97d03b9b62823 Mon Sep 17 00:00:00 2001 From: Oleg Efimov Date: Thu, 29 Sep 2011 13:24:03 +0400 Subject: [PATCH] FloorDiv (//) should return integer value according to documentation --- lib/Twig/Node/Expression/Binary/FloorDiv.php | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Twig/Node/Expression/Binary/FloorDiv.php b/lib/Twig/Node/Expression/Binary/FloorDiv.php index e86b1ea..7fbd055 100644 --- a/lib/Twig/Node/Expression/Binary/FloorDiv.php +++ b/lib/Twig/Node/Expression/Binary/FloorDiv.php @@ -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) -- 1.7.2.5