Home  >  Article  >  Backend Development  >  Two ** in PHP can directly find the nth power of a number. Why is there still a pow() function?

Two ** in PHP can directly find the nth power of a number. Why is there still a pow() function?

WBOY
WBOYOriginal
2016-09-30 09:37:301432browse

<code>$a = 2**6;
echo $a;
$b = pow(2,6);
echo $b;</code>

?>

Reply content:

<code>$a = 2**6;
echo $a;
$b = pow(2,6);
echo $b;</code>

?>

You have to look at when this operator was implemented

https://wiki.php.net/rfc/pow-...

Because it needs to be backward compatible

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn