3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sp($a) { $b = 1; $suma = 0; while ($b < $a) { if ($a % $b == 0) { $suma += $b; } $b += 1; } return $suma; } for ($i = 1, $max = 20000; $i <= $max; $i++) { if (sp($i) == $i) { echo $i."\n"; } }
Output for 5.4.5, 5.4.7, 5.4.38 - 5.4.39, 5.4.41 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.4, 7.4.6 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.24, 8.1.28, 8.2.0 - 8.2.11, 8.2.16 - 8.2.18, 8.3.3 - 8.3.6
6 28 496 8128
Process exited with code 137.
Output for 7.4.5, 8.1.25 - 8.1.27, 8.2.12 - 8.2.15, 8.3.0 - 8.3.2
6 28 496 8128
Output for 5.4.2 - 5.4.4, 5.4.6, 5.4.8 - 5.4.37, 5.4.40
6 28 496
Process exited with code 137.

preferences:
161.49 ms | 402 KiB | 226 Q