Calculate the age of something (PHP)

$endDate = strtotime((null === $endDate) ? 'now' : $endDate);
$startDate = strtotime($startDate);
 
$age = 0;
while ($endDate > $startDate = strtotime('+1 year', $startDate)) {
 
   ++$age;
}
 
return $age;