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(); } } } $n = 1000000; $t = microtime(true); test($n); echo (microtime(true) - $t)*1000000/$n . ' us/iteration';
Output for 7.1.0
0.086023092269897 us/iteration
Output for 7.0.14
0.14201402664185 us/iteration
Output for 7.0.10
0.092875003814697 us/iteration
Output for 7.0.9
0.1330680847168 us/iteration
Output for 7.0.8
0.087515115737915 us/iteration
Output for 7.0.7
0.08219313621521 us/iteration
Output for 7.0.6
0.075370073318481 us/iteration
Output for 7.0.5
0.069476127624512 us/iteration
Output for 7.0.4
0.070624828338623 us/iteration
Output for 7.0.3
0.084437131881714 us/iteration
Output for 7.0.2
0.11719107627869 us/iteration
Output for 7.0.1
0.11158585548401 us/iteration
Output for 7.0.0
0.089248895645142 us/iteration
Output for 5.6.28
0.25814700126648 us/iteration
Output for 5.6.25
0.23689603805542 us/iteration
Output for 5.6.24
0.23382997512817 us/iteration
Output for 5.6.23
0.22969102859497 us/iteration
Output for 5.6.22
0.17123603820801 us/iteration
Output for 5.6.21
0.21245098114014 us/iteration
Output for 5.6.20
0.17949509620667 us/iteration
Output for 5.6.19
0.23679709434509 us/iteration
Output for 5.6.18
0.22912502288818 us/iteration
Output for 5.6.17
0.21146893501282 us/iteration
Output for 5.6.16
0.24425506591797 us/iteration
Output for 5.6.15
0.22135281562805 us/iteration
Output for 5.6.14
0.25141787528992 us/iteration
Output for 5.6.13
0.23512005805969 us/iteration
Output for 5.6.12
0.30327701568604 us/iteration
Output for 5.6.11
0.24359798431396 us/iteration
Output for 5.6.10
0.28531694412231 us/iteration
Output for 5.6.9
0.24970698356628 us/iteration
Output for 5.6.8
0.23198580741882 us/iteration
Output for 5.6.7
0.23310804367065 us/iteration
Output for 5.6.6
0.22918701171875 us/iteration
Output for 5.6.5
0.21055197715759 us/iteration
Output for 5.6.4
0.22049403190613 us/iteration
Output for 5.6.3
0.27365589141846 us/iteration
Output for 5.6.2
0.28761506080627 us/iteration
Output for 5.6.1
0.25253796577454 us/iteration
Output for 5.6.0
0.22456812858582 us/iteration
Output for 5.5.38
0.21605515480042 us/iteration
Output for 5.5.37
0.23004388809204 us/iteration
Output for 5.5.36
0.20354700088501 us/iteration
Output for 5.5.35
0.21109890937805 us/iteration
Output for 5.5.34
0.17667603492737 us/iteration
Output for 5.5.33
0.17396211624146 us/iteration
Output for 5.5.32
0.21144604682922 us/iteration
Output for 5.5.31
0.22727799415588 us/iteration
Output for 5.5.30
0.24206805229187 us/iteration
Output for 5.5.29
0.22290682792664 us/iteration
Output for 5.5.28
0.2419011592865 us/iteration
Output for 5.5.27
0.23452687263489 us/iteration
Output for 5.5.26
0.24840211868286 us/iteration
Output for 5.5.25
0.22396302223206 us/iteration
Output for 5.5.24
0.24397802352905 us/iteration
Output for 5.5.23
0.2090790271759 us/iteration
Output for 5.5.22
0.23139595985413 us/iteration
Output for 5.5.21
0.22123193740845 us/iteration
Output for 5.5.20
0.22079706192017 us/iteration
Output for 5.5.19
0.22195911407471 us/iteration
Output for 5.5.18
0.25603699684143 us/iteration
Output for 5.5.16
0.22539091110229 us/iteration
Output for 5.5.15
0.25912690162659 us/iteration
Output for 5.5.14
0.24321389198303 us/iteration
Output for 5.5.13
0.23383092880249 us/iteration
Output for 5.5.12
0.24828696250916 us/iteration
Output for 5.5.11
0.23616600036621 us/iteration
Output for 5.5.10
0.2710747718811 us/iteration
Output for 5.5.9
0.22561883926392 us/iteration
Output for 5.5.8
0.23656392097473 us/iteration
Output for 5.5.7
0.22101998329163 us/iteration
Output for 5.5.6
0.2207498550415 us/iteration
Output for 5.5.5
0.21361899375916 us/iteration
Output for 5.5.4
0.22163414955139 us/iteration
Output for 5.5.3
0.237056016922 us/iteration
Output for 5.5.2
0.23063206672668 us/iteration
Output for 5.5.1
0.2261950969696 us/iteration
Output for 5.5.0
0.22757577896118 us/iteration
Output for 5.4.45
0.23933410644531 us/iteration
Output for 5.4.44
0.21845602989197 us/iteration
Output for 5.4.43
0.22868704795837 us/iteration
Output for 5.4.42
0.2141227722168 us/iteration
Output for 5.4.41
0.22833323478699 us/iteration
Output for 5.4.40
0.22094106674194 us/iteration
Output for 5.4.39
0.24102711677551 us/iteration
Output for 5.4.38
0.21757006645203 us/iteration
Output for 5.4.37
0.23977899551392 us/iteration
Output for 5.4.36
0.22358703613281 us/iteration
Output for 5.4.35
0.21385407447815 us/iteration
Output for 5.4.34
0.23890399932861 us/iteration
Output for 5.4.32
0.23399996757507 us/iteration
Output for 5.4.31
0.2335250377655 us/iteration
Output for 5.4.30
0.23508715629578 us/iteration
Output for 5.4.29
0.29190301895142 us/iteration
Output for 5.4.28
0.26364088058472 us/iteration
Output for 5.4.27
0.23013806343079 us/iteration
Output for 5.4.26
0.26447486877441 us/iteration
Output for 5.4.25
0.24905204772949 us/iteration
Output for 5.4.24
0.24686598777771 us/iteration
Output for 5.4.23
0.29769086837769 us/iteration
Output for 5.4.22
0.2355010509491 us/iteration
Output for 5.4.21
0.21791100502014 us/iteration
Output for 5.4.20
0.23951888084412 us/iteration
Output for 5.4.19
0.2398669719696 us/iteration
Output for 5.4.18
0.22211623191833 us/iteration
Output for 5.4.17
0.21268820762634 us/iteration
Output for 5.4.16
0.23161506652832 us/iteration
Output for 5.4.15
0.26486396789551 us/iteration
Output for 5.4.14
0.22477507591248 us/iteration
Output for 5.4.13
0.21372485160828 us/iteration
Output for 5.4.12
0.22685098648071 us/iteration
Output for 5.4.11
0.22450995445251 us/iteration
Output for 5.4.10
0.24020504951477 us/iteration
Output for 5.4.9
0.2344651222229 us/iteration
Output for 5.4.8
0.24740099906921 us/iteration
Output for 5.4.7
0.24983191490173 us/iteration
Output for 5.4.6
0.23460507392883 us/iteration
Output for 5.4.5
0.21236705780029 us/iteration
Output for 5.4.4
0.24850702285767 us/iteration
Output for 5.4.3
0.20840096473694 us/iteration
Output for 5.4.2
0.22832083702087 us/iteration
Output for 5.4.1
0.25114297866821 us/iteration
Output for 5.4.0
0.25191903114319 us/iteration
Output for 5.3.29
0.50570201873779 us/iteration
Output for 5.3.28
0.50287103652954 us/iteration
Output for 5.3.27
0.51311707496643 us/iteration
Output for 5.3.26
0.50376200675964 us/iteration
Output for 5.3.25
0.58741116523743 us/iteration
Output for 5.3.24
0.51358413696289 us/iteration
Output for 5.3.23
0.5121488571167 us/iteration
Output for 5.3.22
0.49923396110535 us/iteration
Output for 5.3.21
0.45643210411072 us/iteration
Output for 5.3.20
0.50159001350403 us/iteration
Output for 5.3.19
0.50508189201355 us/iteration
Output for 5.3.18
0.52691197395325 us/iteration
Output for 5.3.17
0.49992394447327 us/iteration
Output for 5.3.16
0.50437784194946 us/iteration
Output for 5.3.15
0.48704814910889 us/iteration
Output for 5.3.14
0.49275183677673 us/iteration
Output for 5.3.13
0.50389003753662 us/iteration
Output for 5.3.12
0.51206803321838 us/iteration
Output for 5.3.11
0.48305177688599 us/iteration
Output for 5.3.10
0.49032306671143 us/iteration
Output for 5.3.9
0.48166084289551 us/iteration
Output for 5.3.8
0.5086510181427 us/iteration
Output for 5.3.7
0.49602293968201 us/iteration
Output for 5.3.6
0.48161196708679 us/iteration
Output for 5.3.5
0.49582600593567 us/iteration
Output for 5.3.4
0.38719010353088 us/iteration
Output for 5.3.3
0.45601892471313 us/iteration
Output for 5.3.2
0.42809700965881 us/iteration
Output for 5.3.1
0.47373199462891 us/iteration
Output for 5.3.0
0.40835404396057 us/iteration
Output for 5.2.17
0.64550805091858 us/iteration
Output for 5.2.16
0.58358502388 us/iteration
Output for 5.2.15
0.58399391174316 us/iteration
Output for 5.2.14
0.6095290184021 us/iteration
Output for 5.2.13
0.58777809143066 us/iteration
Output for 5.2.12
0.66861987113953 us/iteration
Output for 5.2.11
0.62095403671265 us/iteration
Output for 5.2.10
0.70308995246887 us/iteration
Output for 5.2.9
0.61611485481262 us/iteration
Output for 5.2.8
0.70874214172363 us/iteration
Output for 5.2.7
0.68981003761292 us/iteration
Output for 5.2.6
0.71115303039551 us/iteration
Output for 5.2.5
0.70873618125916 us/iteration
Output for 5.2.4
0.71622109413147 us/iteration
Output for 5.2.3
0.73264312744141 us/iteration
Output for 5.2.2
0.66757392883301 us/iteration
Output for 5.2.1
0.56853890419006 us/iteration
Output for 5.2.0
0.67154121398926 us/iteration
Output for 5.1.6
0.713947057724 us/iteration
Output for 5.1.5
0.75821709632874 us/iteration
Output for 5.1.4
0.73214888572693 us/iteration
Output for 5.1.3
0.81354403495789 us/iteration
Output for 5.1.2
0.76973390579224 us/iteration
Output for 5.1.1
0.68467402458191 us/iteration
Output for 5.1.0
0.74447107315063 us/iteration
Output for 5.0.0 - 5.0.5
Fatal error: Class 'RuntimeException' not found in /in/HNImN 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/HNImN 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/HNImN on line 21
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/HNImN on line 21
Process exited with code 255.