phpmathparse-errorphp-parse-error

PHP 'power of' results in parse error


The following code:

5 ** 2

results in this error:

PHP Parse error:  syntax error, unexpected '*'

And I have no idea why. Can anyone help me?


Solution

  • Use pow() function. Get returned value of pow(5,2)

    http://www.php.net/manual/pt_BR/function.pow.php