3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
$<?php function iprimes_upto($limit){ for ($i = 2; $i < $limit; $i++){ $primes[$i] = true; } for ($n = 2; $n < $limit; $n++){ if ($primes[$n]){ for ($i = $n*$n; $i < $limit; $i += $n){ $primes[$i] = false; } } } return $primes; } iprimes_upto(10000); ?>
based on 0e5Dc
Output for 4.3.0 - 7.1.0
$