php - Is (int)$var same as intval($var)? -


possible duplicates:
fastest way convert string integer in php
php: there particular difference between intval , (int)?

is (int)$var same intval($var) ?

apparently both same thing.

is there situation in return different results?

(int) seem bit faster intval, don't have overhead of function call. intval allows set optional base convert to, might useful:

int intval ( mixed $var [, int $base = 10 ] ) 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -