go to bug id or search bugs for
It would be nice to have an exponential operator. ** would be a logical choice, just like in C.
echo 2**3; // prints 8
I know we have pow(), but an operator for this would be nice...
Add a Patch
Add a Pull Request
** is Pascal, not C
I proposed that earlier (along with ^^) [ZendEnginge ML, june 27th & july 3rd].
Anyway, I think it should be added, there is simply no power operator now, and pow() is both a bit bugly and overloaded (both ^^ and ** at the same time).
not going to happen. just suck it up and use pow().
le why not?
Indeed! Seems very despotic just to say "No. Deal with it" with no further
discussion or explanation why.
@tom Exponentiation is an operation that is used too little (in PHP) to warrant adding an extra operator for it. Doing a random guess, I'd think it's used even less than the bitwise operators (and those are used quite rarely in PHP...)