PHP has had type hints and type declarations for several versions, but they haven't really been available in all contexts. Class-based type hints on method parameters arrived in PHP 5.x, and PHP 7.0 added Scalar type declarations. You can set a type on a method parameter, or specify a return type, but in PHP 7.4 we got something really fun: Now you can declare a type on a class property.