What are some potential pitfalls to consider when calculating someone's exact age using PHP?

One potential pitfall when calculating someone's exact age using PHP is not accounting for leap years. Leap years occur every four years, so failing to consider this can result in inaccuracies in the age calculation. To solve this issue, you can use PHP's DateTime class, which automatically handles leap years when calculating differences between dates.

$birthdate = new DateTime('1990-02-29');
$today = new DateTime();
$interval = $birthdate->diff($today);
$age = $interval->y;

echo "The person's age is: " . $age;