3 ms·
> It is not much worse than using it in javascript. It is worse because people are even less familiar with this in PHP. It's not idiomatic. > I just tested it
by TazeTSchnitzel 11y ago
> It is not much worse than using it in javascript.
It is worse because people are even less familiar with this in PHP. It's not idiomatic.
> I just tested it in PHP and it seems it is 20% faster in PHP compared to casting to int.
How rigorous was your testing? Which version of PHP were you using?
> It makes sense in javascript to that its faster than functions, but why it is faster than a cast in PHP?
It shouldn't be. It might save an allocation in older PHP versions, I'm not sure.