Permalink
Browse files

FloorDiv (//) should return integer value according to documentation

  • Loading branch information...
1 parent f96d8d8 commit 68ec644936634aa8d83cf72ebaf97d03b9b62823 @Sannis Sannis committed Sep 29, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Twig/Node/Expression/Binary/FloorDiv.php
View
4 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)

0 comments on commit 68ec644

Please sign in to comment.