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

sql - text truncated using perl DBI insert -

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

php - Pass object by reference or value -