mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-19 05:46:41 +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
|
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)
|
public function operator(Twig_Compiler $compiler)
|
||||||
{
|
{
|
||||||
return $compiler->raw('**');
|
return $compiler->raw('**');
|
||||||
|
|||||||
Reference in New Issue
Block a user