What potential pitfalls should be considered when using PHP scripts to calculate age, especially for individuals born before 1970?

When calculating age using PHP scripts for individuals born before 1970, one potential pitfall to consider is the handling of dates before the Unix epoch (January 1, 1970). PHP's date functions may not work correctly with dates prior to 1970, leading to inaccurate age calculations. To address this issue, it is recommended to use the DateTime object in PHP, which provides better support for handling dates outside the Unix epoch.

$birthdate = '1960-05-15';
$today = new DateTime('now');
$diff = date_diff(new DateTime($birthdate), $today);
$age = $diff->y;
echo "Age: " . $age;