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