mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-12 10:26:32 +00:00
Use ** operator over function pow()
This commit is contained in:
committed by
Fabien Potencier
parent
eeed841497
commit
97f815930e
@@ -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('**');
|
||||
|
||||
Reference in New Issue
Block a user