Doing a cast like (int) $var instead of the intval($var) function is about 300% to 650% faster. I did some tests out of curiousity in #13317 and those are the results: Running the Tests Speed comparison (int)$val vs. intval($val) [System #1] # INPUT (INT)$val INTVAL($val) RATIO ---------------------------------------------------------------------------- #0 42 : 0.068180 / 0.448819 658% #1 -42 : 0.
![PHP: Casting vs. intval()](https://cdn-ak-scissors.b.st-hatena.com/image/square/8d71ff5111e05619a10d29bb40d7aebaa75c8fbc/height=288;version=1;width=512/https%3A%2F%2Fs0.wp.com%2Fi%2Fblank.jpg)