3v4l.org

run code in 150+ 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; } } }
Output for 5.1.0 - 5.6.28, 7.0.0 - 7.1.0
302443
Output for 4.3.0 - 5.0.5, hhvm-3.10.0 - 3.12.0

Process exited with code 137.