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) { return false; } } } $n = 1000000; $t = microtime(true); test($n); echo (microtime(true) - $t)*1000000/$n . ' us/iteration';
Output for 7.1.0
0.13360285758972 us/iteration
Output for 7.0.14
0.14514088630676 us/iteration
Output for 7.0.8
0.10839605331421 us/iteration
Output for 7.0.7
0.11574101448059 us/iteration
Output for 7.0.6
0.10747385025024 us/iteration
Output for 7.0.5
0.087038040161133 us/iteration
Output for 7.0.4
0.0866858959198 us/iteration
Output for 7.0.3
0.1098370552063 us/iteration
Output for 7.0.2
0.11966919898987 us/iteration
Output for 7.0.1
0.10998606681824 us/iteration
Output for 7.0.0
0.092890024185181 us/iteration
Output for hhvm-3.12.0
0.31683921813965 us/iteration
Output for hhvm-3.10.0
0.3814799785614 us/iteration
Output for 5.6.28
0.26630783081055 us/iteration
Output for 5.6.23
0.22998595237732 us/iteration
Output for 5.6.22
0.22290396690369 us/iteration
Output for 5.6.21
0.24541878700256 us/iteration
Output for 5.6.20
0.23237109184265 us/iteration
Output for 5.6.19
0.24119305610657 us/iteration
Output for 5.6.18
0.26532602310181 us/iteration
Output for 5.6.17
0.23054909706116 us/iteration
Output for 5.6.16
0.25521492958069 us/iteration
Output for 5.6.15
0.24856090545654 us/iteration
Output for 5.6.14
0.21691489219666 us/iteration
Output for 5.6.13
0.27816915512085 us/iteration
Output for 5.6.12
0.22598695755005 us/iteration
Output for 5.6.11
0.23085784912109 us/iteration
Output for 5.6.10
0.21895503997803 us/iteration
Output for 5.6.9
0.26684713363647 us/iteration
Output for 5.6.8
0.25415205955505 us/iteration
Output for 5.6.7
0.25240015983582 us/iteration
Output for 5.6.6
0.2111668586731 us/iteration
Output for 5.6.5
0.20945715904236 us/iteration
Output for 5.6.4
0.24533295631409 us/iteration
Output for 5.6.3
0.21653199195862 us/iteration
Output for 5.6.2
0.25308990478516 us/iteration
Output for 5.6.1
0.24802899360657 us/iteration
Output for 5.6.0
0.24491095542908 us/iteration
Output for 5.5.37
0.21348309516907 us/iteration
Output for 5.5.36
0.24223613739014 us/iteration
Output for 5.5.35
0.24390888214111 us/iteration
Output for 5.5.34
0.21057987213135 us/iteration
Output for 5.5.33
0.21775197982788 us/iteration
Output for 5.5.32
0.2309250831604 us/iteration
Output for 5.5.31
0.21756196022034 us/iteration
Output for 5.5.30
0.2112820148468 us/iteration
Output for 5.5.29
0.22475004196167 us/iteration
Output for 5.5.28
0.21896386146545 us/iteration
Output for 5.5.27
0.21385788917542 us/iteration
Output for 5.5.26
0.24956703186035 us/iteration
Output for 5.5.25
0.20390892028809 us/iteration
Output for 5.5.24
0.21329188346863 us/iteration
Output for 5.5.23
0.20836496353149 us/iteration
Output for 5.5.22
0.24138903617859 us/iteration
Output for 5.5.21
0.23841786384583 us/iteration
Output for 5.5.20
0.22390818595886 us/iteration
Output for 5.5.19
0.24794507026672 us/iteration
Output for 5.5.18
0.223876953125 us/iteration
Output for 5.5.16
0.22048401832581 us/iteration
Output for 5.5.15
0.24166107177734 us/iteration
Output for 5.5.14
0.23116302490234 us/iteration
Output for 5.5.13
0.23376202583313 us/iteration
Output for 5.5.12
0.21237111091614 us/iteration
Output for 5.5.11
0.20740389823914 us/iteration
Output for 5.5.10
0.16833019256592 us/iteration
Output for 5.5.9
0.19686818122864 us/iteration
Output for 5.5.8
0.21124410629272 us/iteration
Output for 5.5.7
0.1777331829071 us/iteration
Output for 5.5.6
0.18564414978027 us/iteration
Output for 5.5.5
0.17528200149536 us/iteration
Output for 5.5.4
0.19994401931763 us/iteration
Output for 5.5.3
0.2248899936676 us/iteration
Output for 5.5.2
0.20601987838745 us/iteration
Output for 5.5.1
0.2167010307312 us/iteration
Output for 5.5.0
0.23071193695068 us/iteration
Output for 5.4.45
0.21842885017395 us/iteration
Output for 5.4.44
0.20387983322144 us/iteration
Output for 5.4.43
0.22189998626709 us/iteration
Output for 5.4.42
0.244215965271 us/iteration
Output for 5.4.41
0.21476006507874 us/iteration
Output for 5.4.40
0.20856094360352 us/iteration
Output for 5.4.39
0.22289609909058 us/iteration
Output for 5.4.38
0.21423006057739 us/iteration
Output for 5.4.37
0.2265031337738 us/iteration
Output for 5.4.36
0.25535416603088 us/iteration
Output for 5.4.35
0.21929979324341 us/iteration
Output for 5.4.34
0.25185680389404 us/iteration
Output for 5.4.32
0.23240208625793 us/iteration
Output for 5.4.31
0.22780799865723 us/iteration
Output for 5.4.30
0.22591280937195 us/iteration
Output for 5.4.29
0.26138496398926 us/iteration
Output for 5.4.28
0.24643898010254 us/iteration
Output for 5.4.27
0.23457002639771 us/iteration
Output for 5.4.26
0.21627712249756 us/iteration
Output for 5.4.25
0.18414902687073 us/iteration
Output for 5.4.24
0.19158887863159 us/iteration
Output for 5.4.23
0.18966698646545 us/iteration
Output for 5.4.22
0.23326301574707 us/iteration
Output for 5.4.21
0.23637294769287 us/iteration
Output for 5.4.20
0.23707509040833 us/iteration
Output for 5.4.19
0.21911001205444 us/iteration
Output for 5.4.18
0.21457099914551 us/iteration
Output for 5.4.17
0.2412428855896 us/iteration
Output for 5.4.16
0.21853613853455 us/iteration
Output for 5.4.15
0.22973489761353 us/iteration
Output for 5.4.14
0.20503306388855 us/iteration
Output for 5.4.13
0.24244713783264 us/iteration
Output for 5.4.12
0.23570799827576 us/iteration
Output for 5.4.11
0.21491980552673 us/iteration
Output for 5.4.10
0.24032306671143 us/iteration
Output for 5.4.9
0.23992013931274 us/iteration
Output for 5.4.8
0.22163486480713 us/iteration
Output for 5.4.7
0.20648694038391 us/iteration
Output for 5.4.6
0.21322202682495 us/iteration
Output for 5.4.5
0.24649286270142 us/iteration
Output for 5.4.4
0.23016500473022 us/iteration
Output for 5.4.3
0.22997689247131 us/iteration
Output for 5.4.2
0.21803689002991 us/iteration
Output for 5.4.1
0.25728392601013 us/iteration
Output for 5.4.0
0.22606897354126 us/iteration
Output for 5.3.29
0.50395512580872 us/iteration
Output for 5.3.28
0.42055511474609 us/iteration
Output for 5.3.27
0.5117039680481 us/iteration
Output for 5.3.26
0.51541495323181 us/iteration
Output for 5.3.25
0.48454189300537 us/iteration
Output for 5.3.24
0.52800989151001 us/iteration
Output for 5.3.23
0.50752305984497 us/iteration
Output for 5.3.22
0.48322296142578 us/iteration
Output for 5.3.21
0.49432301521301 us/iteration
Output for 5.3.20
0.47605419158936 us/iteration
Output for 5.3.19
0.51011800765991 us/iteration
Output for 5.3.18
0.46517300605774 us/iteration
Output for 5.3.17
0.49912095069885 us/iteration
Output for 5.3.16
0.51451110839844 us/iteration
Output for 5.3.15
0.49270582199097 us/iteration
Output for 5.3.14
0.4643030166626 us/iteration
Output for 5.3.13
0.38397598266602 us/iteration
Output for 5.3.12
0.4887261390686 us/iteration
Output for 5.3.11
0.47250008583069 us/iteration
Output for 5.3.10
0.48624396324158 us/iteration
Output for 5.3.9
0.49012017250061 us/iteration
Output for 5.3.8
0.49945402145386 us/iteration
Output for 5.3.7
0.46298694610596 us/iteration
Output for 5.3.6
0.44866108894348 us/iteration
Output for 5.3.5
0.49659895896912 us/iteration
Output for 5.3.4
0.46542191505432 us/iteration
Output for 5.3.3
0.49591708183289 us/iteration
Output for 5.3.2
0.45292901992798 us/iteration
Output for 5.3.1
0.39498114585876 us/iteration
Output for 5.3.0
0.4906690120697 us/iteration
Output for 5.2.17
0.69205808639526 us/iteration
Output for 5.2.16
0.70186901092529 us/iteration
Output for 5.2.15
0.72351002693176 us/iteration
Output for 5.2.14
0.6126229763031 us/iteration
Output for 5.2.13
0.56245994567871 us/iteration
Output for 5.2.12
0.62051486968994 us/iteration
Output for 5.2.11
0.63483095169067 us/iteration
Output for 5.2.10
0.69848704338074 us/iteration
Output for 5.2.9
0.62669110298157 us/iteration
Output for 5.2.8
0.57143020629883 us/iteration
Output for 5.2.7
0.64029598236084 us/iteration
Output for 5.2.6
0.6485481262207 us/iteration
Output for 5.2.5
0.71767997741699 us/iteration
Output for 5.2.4
0.63160014152527 us/iteration
Output for 5.2.3
0.73088216781616 us/iteration
Output for 5.2.2
0.6085159778595 us/iteration
Output for 5.2.1
0.71158599853516 us/iteration
Output for 5.2.0
0.72756886482239 us/iteration
Output for 5.1.6
0.68185615539551 us/iteration
Output for 5.1.5
0.75747108459473 us/iteration
Output for 5.1.4
0.76187491416931 us/iteration
Output for 5.1.3
0.74796080589294 us/iteration
Output for 5.1.2
0.74390292167664 us/iteration
Output for 5.1.1
0.74936103820801 us/iteration
Output for 5.1.0
0.7674388885498 us/iteration
Output for 5.0.0 - 5.0.5
Fatal error: Class 'RuntimeException' not found in /in/oZrQb 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/oZrQb 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/oZrQb on line 21
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/oZrQb on line 21
Process exited with code 255.