The PHP website tells you which versions each function is supported in and often the version a function was first introduced in, but it doesn't do the same for older language features. When was type casting first introduced? i.e.
PHP 3.0 was released in October 2000.[1, scroll bottom]
Code about type casting could be found in one of the earliest php-src commits, which was in 1999. This proves that type casting most likely existed in PHP 3.
PHP 2 docs asked users to use
IntVal() to move the type from double to int, which suggests that PHP 2 didn't have type casting directly.
Therefore it can be deduced that type casting was introduced in PHP 3.
(int)$varis a weird new feature and that
settype($var, 'int')is much better.
intval()) why would you avoid its use?