src/Birthday/Birthday.php
public static function calculateAge($year, $month, $day): int
    {
        $currentYear = date('Y');
        $currentMonth = date('n');
        $currentDay = date('j');
        $age = $currentYear - $year;
        if ($currentMonth < $month || ($currentMonth == $month && $currentDay < $day)) {
            $age--;
        }
        if ($age < 0) {
            $age = 0;
        }

        return $age;
    }
public static function calculateAge($year, $month, $day): int
    {
        $currentYear = date('Y');
        $currentMonth = date('n');
        $currentDay = date('j');
        $age = $currentYear - $year;
        if ($currentMonth < $month || ($currentMonth == $month && $currentDay < $day)) {
            $age--;
        }
        if ($age < 0) {
            $age = 0;
        }

        return $age;
    }
Calculate age

@param  int   $year
@param  int   $month
@param  int   $day
@return int