Ad

Given an array of random numbers. Return the number of even numbers in the array.

function calculateEvenNumbers(array $numbers): int {
  $result = [];
  
  foreach ($numbers as $number) {
    if ($number % 2 === 0) {
      $result[] = $number;
    }
  }
    
  return count($result);
}