1<?php
2
3/*
4 * This file is part of Twig.
5 *
6 * (c) Fabien Potencier
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Twig\Node\Expression\Binary;
13
14use Twig\Compiler;
15
16class PowerBinary extends AbstractBinary
17{
18    public function compile(Compiler $compiler)
19    {
20        if (\PHP_VERSION_ID >= 50600) {
21            return parent::compile($compiler);
22        }
23
24        $compiler
25            ->raw('pow(')
26            ->subcompile($this->getNode('left'))
27            ->raw(', ')
28            ->subcompile($this->getNode('right'))
29            ->raw(')')
30        ;
31    }
32
33    public function operator(Compiler $compiler)
34    {
35        return $compiler->raw('**');
36    }
37}
38
39class_alias('Twig\Node\Expression\Binary\PowerBinary', 'Twig_Node_Expression_Binary_Power');
40