(PHP 7 >= 7.4.0, PHP 8)
ReflectionProperty::getType — Récupère le type d'une propriété
Récupère le type associé à une propriété.
Cette fonction ne contient aucun paramètre.
   Retourne une ReflectionType si la propriété à un type,
   et null sinon.
  
Exemple #1 Exemple de ReflectionProperty::getType()
<?php
class User
{
    public string $name;
}
$rp = new ReflectionProperty('User', 'name');
echo $rp->getType()->getName();
?>
L'exemple ci-dessus va afficher :
string