Use ** operator over function pow()

This commit is contained in:
SpacePossum
2016-11-16 08:16:04 +01:00
committed by Fabien Potencier
parent eeed841497
commit 97f815930e
-15
View File
@@ -10,21 +10,6 @@
*/
class Twig_Node_Expression_Binary_Power extends Twig_Node_Expression_Binary
{
public function compile(Twig_Compiler $compiler)
{
if (PHP_VERSION_ID >= 50600) {
return parent::compile($compiler);
}
$compiler
->raw('pow(')
->subcompile($this->getNode('left'))
->raw(', ')
->subcompile($this->getNode('right'))
->raw(')')
;
}
public function operator(Twig_Compiler $compiler)
{
return $compiler->raw('**');