3v4l.org

run code in 300+ PHP versions simultaneously
<?php register_tick_function(function () { echo "Tick", PHP_EOL; throw new \Exception("Software interrupt"); }); declare(ticks=1e2) { try { $loopIndex = 0; while ($loopIndex < 1e3) { $loopIndex++; echo "Index {$loopIndex}", PHP_EOL; } } catch (\Exception $e) { echo "Received termination signal"; } }
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.11, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.12 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Index 1 Index 2 Index 3 Index 4 Index 5 Index 6 Index 7 Index 8 Index 9 Index 10 Index 11 Index 12 Index 13 Index 14 Index 15 Index 16 Index 17 Index 18 Index 19 Index 20 Index 21 Index 22 Index 23 Index 24 Index 25 Index 26 Index 27 Index 28 Index 29 Index 30 Index 31 Index 32 Index 33 Tick Received termination signal
Output for 5.6.12 - 5.6.28
Index 1 Index 2 Index 3 Index 4 Index 5 Index 6 Index 7 Index 8 Index 9 Index 10 Index 11 Index 12 Index 13 Index 14 Index 15 Index 16 Index 17 Index 18 Index 19 Index 20 Index 21 Index 22 Index 23 Index 24 Index 25 Index 26 Index 27 Index 28 Index 29 Index 30 Index 31 Index 32 Index 33 Index 34 Index 35 Index 36 Index 37 Index 38 Index 39 Index 40 Index 41 Index 42 Index 43 Index 44 Index 45 Index 46 Index 47 Index 48 Index 49 Tick Received termination signal
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/lm5lI on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION, expecting ')' in /in/lm5lI on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/lm5lI on line 3
Process exited with code 255.

preferences:
232.33 ms | 401 KiB | 310 Q