3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function x($n) { for($i = 1; $i <= $n; $i++) { if ($n % $i == 0 && $i != $n) { $factors[] = $i; echo "$i is a factor of $n." . PHP_EOL; } elseif ($i == $n) { echo "Removing $n from array.." . PHP_EOL; } } if ($n == array_sum($a) / 2) { echo "It's perfect!" . PHP_EOL; } elseif { echo "It's not perfect!" . PHP_EOL; } } x(42); ?>
Output for 5.3.0 - 5.4.12
Parse error: syntax error, unexpected '{', expecting '(' in /in/9W2Bf on line 15
Process exited with code 255.