3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function isPrime($num) { for ($i=2; i < $num/2; $i++) { if ($num % $i == 0) { return false; } } return true; } var_dump(isPrime(10));
based on t7En5
Output for 7.2.0
Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/6uZJ2 on line 4 bool(false)
Output for 5.3.18 - 7.1.10
Notice: Use of undefined constant i - assumed 'i' in /in/6uZJ2 on line 4 bool(false)