3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isPrime($number) { $max = floor(sqrt($number)); for ($i=1; $i < $max; $i++) { if ($number % $i == 0) return false; } return true; } do { $i = mt_rand(1, 999); while ( ! isPrime($i) ); var_dump($i);
Output for 5.4.0 - 5.4.28, 5.5.0 - 5.5.12
Parse error: syntax error, unexpected end of file in /in/oK816 on line 16
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected $end in /in/oK816 on line 16
Process exited with code 255.

preferences:
184.84 ms | 1395 KiB | 78 Q