From: Oleg Efimov Date: Thu, 29 Sep 2011 09:24:03 +0000 (+0400) Subject: FloorDiv (//) should return integer value according to documentation X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=68ec644936634aa8d83cf72ebaf97d03b9b62823;p=web%2Fkonrad%2Ftwig.git FloorDiv (//) should return integer value according to documentation --- 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)