3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function isPrime($num) { for ($i = 2; $i < $num; $i++) { if ($num % $i == 0) { return false; } } return true; } function firstAndLastDigitEqual($num, $digit) { return substr($num, 0, 1) == (string)$digit && substr($num, -1) == (string)$digit; } $foundPrimes = 0; for ($i = 1; true; $i++) { if (firstAndLastDigitEqual($i, 3) && isPrime($i)) { if (++$foundPrimes == 333) { echo $i; break; } } }

Abusive script

This script was stopped while abusing our resources

Output for 5.3.3, 5.3.12 - 5.3.14, 5.3.16, 5.3.18 - 5.3.25, 5.4.0 - 5.4.41, 5.4.43 - 5.5.1, 5.5.3 - 5.5.7, 5.5.9 - 5.5.24, 5.5.26, 5.5.28, 5.5.31 - 5.6.10, 5.6.12 - 5.6.13, 5.6.17 - 5.6.30, 7.0.0 - 7.1.6
302443
Output for 4.3.0 - 5.3.2, 5.3.4 - 5.3.11, 5.3.15, 5.3.17, 5.3.26 - 5.3.29, 5.4.42, 5.5.2, 5.5.8, 5.5.25, 5.5.27, 5.5.29 - 5.5.30, 5.6.11, 5.6.14 - 5.6.16, hhvm-3.10.1 - 3.17.3

Process exited with code 137.