What are some alternative methods in PHP for calculating age besides using timestamps?

When calculating age in PHP, timestamps are commonly used by comparing the birthdate to the current date. However, an alternative method to calculate age is by using the DateTime object in PHP. This method simplifies the process and provides a cleaner and more readable code.

$birthdate = new DateTime('1990-05-15');
$currentDate = new DateTime();
$age = $birthdate->diff($currentDate)->y;

echo "Age: " . $age;