foreach loop to iterate through the primes { if prime number currently being considered does not exceed $n { push it to the result list. } }