3v4l.org

run code in 200+ 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(100000); ?>
based on bGoHD
Output for 4.3.0 - 7.1.7, 7.2.0
$
Output for 7.1.10
$
Process exited with code 137.