3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 = 1000000; $t = microtime(true); test($n); echo (microtime(true) - $t)*1000000/$n . ' us/iteration';
Output for 7.1.0
-0.42602300643921 us/iteration
Output for 7.0.14
1.3158180713654 us/iteration
Output for 7.0.7
1.2790281772614 us/iteration
Output for 7.0.6
1.1993730068207 us/iteration
Output for 7.0.5
1.2463340759277 us/iteration
Output for 7.0.4
1.2895610332489 us/iteration
Output for 7.0.3
1.1063411235809 us/iteration
Output for 7.0.2
1.2177631855011 us/iteration
Output for 7.0.1
1.2984089851379 us/iteration
Output for 7.0.0
1.2857689857483 us/iteration
Output for 5.1.0 - 5.3.29, 5.4.15, 5.5.0, 5.5.3, 5.5.7, 5.5.9, 5.5.21, 5.6.6, 5.6.11, 5.6.18 - 5.6.19, 5.6.28

Process exited with code 137.
Output for 5.6.22
2.3520970344543 us/iteration
Output for 5.6.21
2.2159280776978 us/iteration
Output for 5.6.20
2.3498558998108 us/iteration
Output for 5.6.17
2.2975840568542 us/iteration
Output for 5.6.16
2.3793570995331 us/iteration
Output for 5.6.15
2.324630022049 us/iteration
Output for 5.6.14
2.3689770698547 us/iteration
Output for 5.6.13
2.3908369541168 us/iteration
Output for 5.6.12
2.1941721439362 us/iteration
Output for 5.6.10
2.1898519992828 us/iteration
Output for 5.6.9
2.1665549278259 us/iteration
Output for 5.6.8
2.2142889499664 us/iteration
Output for 5.6.7
2.3244109153748 us/iteration
Output for 5.6.5
2.192666053772 us/iteration
Output for 5.6.4
2.3767461776733 us/iteration
Output for 5.6.3
2.3047759532928 us/iteration
Output for 5.6.2
2.2564399242401 us/iteration
Output for 5.6.1
2.1952722072601 us/iteration
Output for 5.6.0
2.2102799415588 us/iteration
Output for 5.5.36
2.3047790527344 us/iteration
Output for 5.5.35
2.2196571826935 us/iteration
Output for 5.5.34
2.3358960151672 us/iteration
Output for 5.5.33
2.279895067215 us/iteration
Output for 5.5.32
2.1747889518738 us/iteration
Output for 5.5.31
2.343936920166 us/iteration
Output for 5.5.30
2.1824259757996 us/iteration
Output for 5.5.29
2.3614549636841 us/iteration
Output for 5.5.28
2.2096769809723 us/iteration
Output for 5.5.27
2.320249080658 us/iteration
Output for 5.5.26
2.3335559368134 us/iteration
Output for 5.5.25
2.3499960899353 us/iteration
Output for 5.5.24
2.3251690864563 us/iteration
Output for 5.5.23
2.3517551422119 us/iteration
Output for 5.5.22
2.2546639442444 us/iteration
Output for 5.5.20
2.2641899585724 us/iteration
Output for 5.5.19
2.1740181446075 us/iteration
Output for 5.5.18
2.1554298400879 us/iteration
Output for 5.5.16
2.2028179168701 us/iteration
Output for 5.5.15
2.3587689399719 us/iteration
Output for 5.5.14
2.3415930271149 us/iteration
Output for 5.5.13
2.343405008316 us/iteration
Output for 5.5.12
2.2814378738403 us/iteration
Output for 5.5.11
2.3577470779419 us/iteration
Output for 5.5.10
2.2377569675446 us/iteration
Output for 5.5.8
2.1583588123322 us/iteration
Output for 5.5.6
2.2688331604004 us/iteration
Output for 5.5.5
2.2026100158691 us/iteration
Output for 5.5.4
2.1919410228729 us/iteration
Output for 5.5.2
2.3711738586426 us/iteration
Output for 5.5.1
2.1685421466827 us/iteration
Output for 5.4.45
2.3103621006012 us/iteration
Output for 5.4.44
2.1119520664215 us/iteration
Output for 5.4.43
2.3316340446472 us/iteration
Output for 5.4.42
2.1359879970551 us/iteration
Output for 5.4.41
2.2775850296021 us/iteration
Output for 5.4.40
2.1136219501495 us/iteration
Output for 5.4.39
2.2523210048676 us/iteration
Output for 5.4.38
2.2681789398193 us/iteration
Output for 5.4.37
2.3516538143158 us/iteration
Output for 5.4.36
2.1315450668335 us/iteration
Output for 5.4.35
2.3258991241455 us/iteration
Output for 5.4.34
2.1089899539948 us/iteration
Output for 5.4.32
2.1163010597229 us/iteration
Output for 5.4.31
2.3734431266785 us/iteration
Output for 5.4.30
2.3148279190063 us/iteration
Output for 5.4.29
2.3912608623505 us/iteration
Output for 5.4.28
2.3047280311584 us/iteration
Output for 5.4.27
2.3626849651337 us/iteration
Output for 5.4.26
2.1644380092621 us/iteration
Output for 5.4.25
2.1716721057892 us/iteration
Output for 5.4.24
2.3796279430389 us/iteration
Output for 5.4.23
2.3107600212097 us/iteration
Output for 5.4.22
2.2278780937195 us/iteration
Output for 5.4.21
2.309807062149 us/iteration
Output for 5.4.20
2.1826257705688 us/iteration
Output for 5.4.19
2.3385457992554 us/iteration
Output for 5.4.18
2.2749679088593 us/iteration
Output for 5.4.17
2.1627659797668 us/iteration
Output for 5.4.16
2.2642650604248 us/iteration
Output for 5.4.14
2.371279001236 us/iteration
Output for 5.4.13
2.3638248443604 us/iteration
Output for 5.4.12
2.3245241641998 us/iteration
Output for 5.4.11
2.4129748344421 us/iteration
Output for 5.4.10
2.2559390068054 us/iteration
Output for 5.4.9
2.1043770313263 us/iteration
Output for 5.4.8
2.3370578289032 us/iteration
Output for 5.4.7
2.3835639953613 us/iteration
Output for 5.4.6
2.2894032001495 us/iteration
Output for 5.4.5
2.2701549530029 us/iteration
Output for 5.4.4
2.172730922699 us/iteration
Output for 5.4.3
2.1244120597839 us/iteration
Output for 5.4.2
2.3472790718079 us/iteration
Output for 5.4.1
2.3268208503723 us/iteration
Output for 5.4.0
2.1409499645233 us/iteration
Output for 5.0.0 - 5.0.5
Fatal error: Class 'RuntimeException' not found in /in/mEE39 on line 21
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_NEW in /in/mEE39 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/mEE39 on line 21
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/mEE39 on line 21
Process exited with code 255.