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; } echo(iprimes_upto(1000)); ?>
based on vVT1v
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
$ Notice: Array to string conversion in /in/0e5Dc on line 15 Array
Output for 4.3.0 - 5.3.29
$Array