3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php global $throw; $throw = false; 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) { echo $e->getLine(); } } } $t = microtime(); test(100000); echo (microtime() - $t) . ' us';
Output for 7.1.0
Notice: A non well formed numeric value encountered in /in/svHTv on line 37 Notice: A non well formed numeric value encountered in /in/svHTv on line 37 0.015043 us
Output for 7.0.14
0.018014 us
Output for 7.0.6
0.013114 us
Output for 7.0.5
0.013809 us
Output for 7.0.4
0.012223 us
Output for 7.0.3
0.0092110000000001 us
Output for 7.0.2
0.009581 us
Output for 7.0.1
0.011128 us
Output for 7.0.0
0.012493 us
Output for hhvm-3.12.0
0.03022 us
Output for hhvm-3.10.0
0.039485 us
Output for 5.6.28
0.034697 us
Output for 5.6.21
0.031552 us
Output for 5.6.20
0.031072 us
Output for 5.6.19
0.030895 us
Output for 5.6.18
0.028934 us
Output for 5.6.17
0.027258 us
Output for 5.6.16
0.033311 us
Output for 5.6.15
0.02047 us
Output for 5.6.14
0.022041 us
Output for 5.6.13
0.022295 us
Output for 5.6.12
0.024775 us
Output for 5.6.11
0.021736 us
Output for 5.6.10
0.031463 us
Output for 5.6.9
0.029746 us
Output for 5.6.8
0.022006 us
Output for 5.5.35
0.021701 us
Output for 5.5.34
0.031114 us
Output for 5.5.33
0.023414 us
Output for 5.5.32
0.025775 us
Output for 5.5.31
0.029735 us
Output for 5.5.30
0.025285 us
Output for 5.5.29
-0.974909 us
Output for 5.5.28
0.030508 us
Output for 5.5.27
0.026871 us
Output for 5.5.26
0.030921 us
Output for 5.5.25
-0.952292 us
Output for 5.5.24
0.027859 us
Output for 5.4.45
0.029289 us
Output for 5.4.44
0.021478 us
Output for 5.4.43
0.026602 us
Output for 5.4.42
0.027853 us
Output for 5.4.41
0.02878 us
Output for 5.4.40
0.029739 us
Output for 5.4.39
0.026589 us
Output for 5.4.38
0.028027 us
Output for 5.4.37
0.028494 us
Output for 5.4.36
0.030064 us
Output for 5.4.35
0.02669 us
Output for 5.4.34
0.029449 us
Output for 5.4.32
0.029409 us
Output for 5.4.31
0.023332 us
Output for 5.4.30
0.026721 us
Output for 5.4.29
0.035152 us
Output for 5.4.28
0.028464 us
Output for 5.4.27
0.02884 us
Output for 5.4.26
0.028422 us
Output for 5.4.25
0.024355 us
Output for 5.4.24
0.02414 us
Output for 5.4.23
0.022396 us
Output for 5.4.22
0.021115 us
Output for 5.4.21
0.033254 us
Output for 5.4.20
0.03299 us
Output for 5.4.19
0.032599 us
Output for 5.4.18
0.029615 us
Output for 5.4.17
0.029891 us
Output for 5.4.16
0.030101 us
Output for 5.4.15
0.022258 us
Output for 5.4.14
0.027291 us
Output for 5.4.13
0.028859 us
Output for 5.4.12
0.030253 us
Output for 5.4.11
0.031281 us
Output for 5.4.10
0.027646 us
Output for 5.4.9
0.028086 us
Output for 5.4.8
0.029283 us
Output for 5.4.7
-0.979539 us
Output for 5.4.6
0.030339 us
Output for 5.4.5
0.02852 us
Output for 5.4.4
0.028701 us
Output for 5.4.3
0.023661 us
Output for 5.4.2
0.025836 us
Output for 5.4.1
-0.970415 us
Output for 5.4.0
0.021637 us
Output for 5.3.29
0.034353 us
Output for 5.3.28
0.032628 us
Output for 5.3.27
0.036562 us
Output for 5.3.26
0.030708 us
Output for 5.3.25
0.027743 us
Output for 5.3.24
0.032777 us
Output for 5.3.23
0.038534 us
Output for 5.3.22
0.036451 us
Output for 5.3.21
0.037257 us
Output for 5.3.20
0.025939 us
Output for 5.3.19
0.025883 us
Output for 5.3.18
0.02993 us
Output for 5.3.17
0.044971 us
Output for 5.3.16
0.037165 us
Output for 5.3.15
0.036418 us
Output for 5.3.14
0.033384 us
Output for 5.3.13
0.027181 us
Output for 5.3.12
0.036144 us
Output for 5.3.11
0.032486 us
Output for 5.3.10
0.025945 us
Output for 5.3.9
0.03741 us
Output for 5.3.8
0.034137 us
Output for 5.3.7
0.036766 us
Output for 5.3.6
0.03845 us
Output for 5.3.5
0.037596 us
Output for 5.3.4
0.035745 us
Output for 5.3.3
0.038296 us
Output for 5.3.2
0.037351 us
Output for 5.3.1
0.036136 us
Output for 5.3.0
0.036783 us
Output for 5.2.17
0.059411 us
Output for 5.2.16
0.04858 us
Output for 5.2.15
0.054475 us
Output for 5.2.14
-0.945537 us
Output for 5.2.13
0.058459 us
Output for 5.2.12
0.061009 us
Output for 5.2.11
0.057719 us
Output for 5.2.10
0.059182 us
Output for 5.2.9
0.058991 us
Output for 5.2.8
0.059567 us
Output for 5.2.7
0.055319 us
Output for 5.2.6
0.057928 us
Output for 5.2.5
0.048446 us
Output for 5.2.4
0.05231 us
Output for 5.2.3
0.055259 us
Output for 5.2.2
0.060486 us
Output for 5.2.1
0.056962 us
Output for 5.2.0
0.063655 us
Output for 5.1.6
0.066878 us
Output for 5.1.5
0.069532 us
Output for 5.1.4
0.062736 us
Output for 5.1.3
0.044533 us
Output for 5.1.2
0.057973 us
Output for 5.1.1
0.063836 us
Output for 5.1.0
0.044143 us
Output for 5.0.0 - 5.0.5
Fatal error: Class 'RuntimeException' not found in /in/svHTv on line 29
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_NEW in /in/svHTv on line 21
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_NEW in /in/svHTv on line 21
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/svHTv on line 21
Process exited with code 255.