3v4l.org

run code in 300+ PHP versions simultaneously
<?php global $throw; $throw = true; function foo() { bar(); } function bar() { baz(); } function baz() { boom(); } function boom() { global $throw; if ($throw) { throw new RuntimeException(); } } function test($n) { for ($i = 0; $i < $n; $i++) { try { foo(); } catch (RuntimeException $e) { $error = true; } } } $n = 100000; $t = microtime(true); test($n); echo (microtime(true) - $t)*1000000/$n . ' us/iteration';

preferences:
24.04 ms | 402 KiB | 5 Q