PHP has come a long way with types. We now have scalar types, return types, nullable types, and even property types in PHP 7.4!
PHP 8.0 comes with support for Union Types!
In versions prior to PHP 8.0, you could only declare a single type for properties, parameters, and return types. PHP 7.1 and newer versions have nullable types, which means you can declare the type to be null with a type declaration similar to ?string.
From PHP 8.0, you can declare more than one type for arguments, return types, and class properties.