How can PHP developers ensure accurate age calculation for users born before 1970, considering the limitations of certain PHP functions?

When calculating the age of users born before 1970, PHP's date functions may encounter issues due to the limitations of representing dates before Unix epoch (January 1, 1970). To ensure accurate age calculation for such users, developers can use the DateTime class in PHP, which provides better support for older dates.

$birthdate = '1950-05-15';
$today = new DateTime('now');
$birthday = new DateTime($birthdate);
$age = $today->diff($birthday)->y;
echo "The user's age is: " . $age;