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';
Output for 7.4.0
0.99435806274414 us/iteration
Output for 7.3.12
1.5812397003174 us/iteration
Output for 7.3.11
1.5888500213623 us/iteration
Output for 7.3.10
1.0270595550537 us/iteration
Output for 7.3.9
1.5970706939697 us/iteration
Output for 7.3.8
1.0288619995117 us/iteration
Output for 7.3.7
0.98719120025635 us/iteration
Output for 7.3.6
1.0042309761047 us/iteration
Output for 7.3.5
0.99822044372559 us/iteration
Output for 7.3.4
1.3170194625854 us/iteration
Output for 7.3.3
1.2966299057007 us/iteration
Output for 7.3.2
1.0724806785583 us/iteration
Output for 7.3.1
0.98194122314453 us/iteration
Output for 7.3.0
0.99186897277832 us/iteration
Output for 7.2.25
1.2968802452087 us/iteration
Output for 7.2.24
1.7762398719788 us/iteration
Output for 7.2.23
1.849319934845 us/iteration
Output for 7.2.22
1.1684894561768 us/iteration
Output for 7.2.21
1.3022708892822 us/iteration
Output for 7.2.20
1.3039684295654 us/iteration
Output for 7.2.19
1.1692309379578 us/iteration
Output for 7.2.18
1.3372898101807 us/iteration
Output for 7.2.17
1.1995482444763 us/iteration
Output for 7.2.0
0.84259986877441 us/iteration
Output for 7.1.33
1.4125895500183 us/iteration
Output for 7.1.32
1.8360710144043 us/iteration
Output for 7.1.31
2.0187401771545 us/iteration
Output for 7.1.30
1.4033603668213 us/iteration
Output for 7.1.29
1.5352702140808 us/iteration
Output for 7.1.28
1.7149782180786 us/iteration
Output for 7.1.27
1.4265704154968 us/iteration
Output for 7.1.26
1.3702297210693 us/iteration
Output for 7.1.7
1.0263013839722 us/iteration
Output for 7.1.6
0.9709095954895 us/iteration
Output for 7.1.5
0.9107494354248 us/iteration
Output for 7.1.0
0.55672883987427 us/iteration
Output for 7.0.20
1.8068695068359 us/iteration
Output for 7.0.14
1.7814898490906 us/iteration
Output for 7.0.10
1.3733506202698 us/iteration
Output for 7.0.9
1.8372583389282 us/iteration
Output for 7.0.8
1.3737010955811 us/iteration
Output for 7.0.7
1.4239692687988 us/iteration
Output for 7.0.6
1.4217305183411 us/iteration
Output for 7.0.5
1.4914798736572 us/iteration
Output for 7.0.4
1.5571188926697 us/iteration
Output for 7.0.3
1.4622783660889 us/iteration
Output for 7.0.2
1.5280294418335 us/iteration
Output for 7.0.1
1.3883900642395 us/iteration
Output for 7.0.0
1.378960609436 us/iteration
Output for 5.6.28
2.7707695960999 us/iteration
Output for 5.6.25
2.9616498947144 us/iteration
Output for 5.6.24
2.7826714515686 us/iteration
Output for 5.6.23
2.736508846283 us/iteration
Output for 5.6.22
3.0397605895996 us/iteration
Output for 5.6.21
2.8383302688599 us/iteration
Output for 5.6.20
3.1856608390808 us/iteration
Output for 5.6.19
2.7706384658813 us/iteration
Output for 5.6.18
2.6421403884888 us/iteration
Output for 5.6.17
2.6578187942505 us/iteration
Output for 5.6.16
2.9727101325989 us/iteration
Output for 5.6.15
2.805769443512 us/iteration
Output for 5.6.14
2.8271293640137 us/iteration
Output for 5.6.13
2.6793909072876 us/iteration
Output for 5.6.12
2.6940417289734 us/iteration
Output for 5.6.11
2.9357409477234 us/iteration
Output for 5.6.10
3.1025886535645 us/iteration
Output for 5.6.9
2.7912902832031 us/iteration
Output for 5.6.8
2.9830718040466 us/iteration
Output for 5.6.7
2.7228903770447 us/iteration
Output for 5.6.6
2.965521812439 us/iteration
Output for 5.6.5
2.815568447113 us/iteration
Output for 5.6.4
2.947199344635 us/iteration
Output for 5.6.3
2.596800327301 us/iteration
Output for 5.6.2
2.3739099502563 us/iteration
Output for 5.6.1
2.6177096366882 us/iteration
Output for 5.6.0
2.608380317688 us/iteration
Output for 5.5.38
2.9520010948181 us/iteration
Output for 5.5.37
3.0608201026917 us/iteration
Output for 5.5.36
2.741219997406 us/iteration
Output for 5.5.35
2.707052230835 us/iteration
Output for 5.5.34
2.7012419700623 us/iteration
Output for 5.5.33
2.8655600547791 us/iteration
Output for 5.5.32
2.7429008483887 us/iteration
Output for 5.5.31
2.8581094741821 us/iteration
Output for 5.5.30
3.1396508216858 us/iteration
Output for 5.5.29
2.7158403396606 us/iteration
Output for 5.5.28
2.8339600563049 us/iteration
Output for 5.5.27
2.7317404747009 us/iteration
Output for 5.5.26
2.9571509361267 us/iteration
Output for 5.5.25
2.9739999771118 us/iteration
Output for 5.5.24
2.8304815292358 us/iteration
Output for 5.5.23
2.84343957901 us/iteration
Output for 5.5.22
2.8216981887817 us/iteration
Output for 5.5.21
2.7334690093994 us/iteration
Output for 5.5.20
3.4144186973572 us/iteration
Output for 5.5.19
2.6404190063477 us/iteration
Output for 5.5.18
2.680230140686 us/iteration
Output for 5.5.16
2.6619100570679 us/iteration
Output for 5.5.15
2.6927495002747 us/iteration
Output for 5.5.14
2.6146101951599 us/iteration
Output for 5.5.13
2.4478101730347 us/iteration
Output for 5.5.12
2.6590585708618 us/iteration
Output for 5.5.11
2.7257919311523 us/iteration
Output for 5.5.10
2.8674387931824 us/iteration
Output for 5.5.9
2.8029799461365 us/iteration
Output for 5.5.8
2.6888918876648 us/iteration
Output for 5.5.7
2.7901601791382 us/iteration
Output for 5.5.6
2.7147793769836 us/iteration
Output for 5.5.5
2.8045392036438 us/iteration
Output for 5.5.4
2.7464199066162 us/iteration
Output for 5.5.3
2.8145694732666 us/iteration
Output for 5.5.2
2.7503895759583 us/iteration
Output for 5.5.1
3.0593395233154 us/iteration
Output for 5.5.0
2.6977896690369 us/iteration
Output for 5.4.45
2.9167580604553 us/iteration
Output for 5.4.44
2.7120399475098 us/iteration
Output for 5.4.43
2.6542592048645 us/iteration
Output for 5.4.42
2.8046607971191 us/iteration
Output for 5.4.41
2.6344203948975 us/iteration
Output for 5.4.40
2.7781987190247 us/iteration
Output for 5.4.39
2.6113891601562 us/iteration
Output for 5.4.38
3.4286904335022 us/iteration
Output for 5.4.37
3.0958294868469 us/iteration
Output for 5.4.36
2.723970413208 us/iteration
Output for 5.4.35
2.7280902862549 us/iteration
Output for 5.4.34
2.6864886283875 us/iteration
Output for 5.4.32
2.5529217720032 us/iteration
Output for 5.4.31
2.5989413261414 us/iteration
Output for 5.4.30
2.536449432373 us/iteration
Output for 5.4.29
2.679979801178 us/iteration
Output for 5.4.28
2.1232604980469 us/iteration
Output for 5.4.27
2.6748895645142 us/iteration
Output for 5.4.26
2.7532410621643 us/iteration
Output for 5.4.25
2.9010605812073 us/iteration
Output for 5.4.24
2.7493715286255 us/iteration
Output for 5.4.23
3.2094407081604 us/iteration
Output for 5.4.22
2.7806186676025 us/iteration
Output for 5.4.21
2.6932096481323 us/iteration
Output for 5.4.20
2.7704787254333 us/iteration
Output for 5.4.19
2.8535389900208 us/iteration
Output for 5.4.18
2.6758599281311 us/iteration
Output for 5.4.17
2.7049803733826 us/iteration
Output for 5.4.16
2.9093909263611 us/iteration
Output for 5.4.15
2.7559995651245 us/iteration
Output for 5.4.14
2.8050708770752 us/iteration
Output for 5.4.13
2.6942610740662 us/iteration
Output for 5.4.12
2.8075194358826 us/iteration
Output for 5.4.11
2.7891302108765 us/iteration
Output for 5.4.10
2.9991793632507 us/iteration
Output for 5.4.9
2.6503801345825 us/iteration
Output for 5.4.8
2.7036499977112 us/iteration
Output for 5.4.7
2.6653909683228 us/iteration
Output for 5.4.6
2.6786804199219 us/iteration
Output for 5.4.5
2.8272700309753 us/iteration
Output for 5.4.4
2.8831386566162 us/iteration
Output for 5.4.3
2.6774597167969 us/iteration
Output for 5.4.2
2.8417301177979 us/iteration
Output for 5.4.1
2.771430015564 us/iteration
Output for 5.4.0
2.7292704582214 us/iteration
Output for 5.3.29
3.4423208236694 us/iteration
Output for 5.3.28
3.3493089675903 us/iteration
Output for 5.3.27
3.1709790229797 us/iteration
Output for 5.3.26
3.2474303245544 us/iteration
Output for 5.3.25
3.1842517852783 us/iteration
Output for 5.3.24
3.9148211479187 us/iteration
Output for 5.3.23
3.3667707443237 us/iteration
Output for 5.3.22
3.3544015884399 us/iteration
Output for 5.3.21
3.3271884918213 us/iteration
Output for 5.3.20
3.3264493942261 us/iteration
Output for 5.3.19
3.3071208000183 us/iteration
Output for 5.3.18
3.2224798202515 us/iteration
Output for 5.3.17
3.3937621116638 us/iteration
Output for 5.3.16
3.5020089149475 us/iteration
Output for 5.3.15
3.4594082832336 us/iteration
Output for 5.3.14
3.3394694328308 us/iteration
Output for 5.3.13
3.4518885612488 us/iteration
Output for 5.3.12
3.3431696891785 us/iteration
Output for 5.3.11
3.4600186347961 us/iteration
Output for 5.3.10
3.4706687927246 us/iteration
Output for 5.3.9
3.2059407234192 us/iteration
Output for 5.3.8
3.1595206260681 us/iteration
Output for 5.3.7
3.4561991691589 us/iteration
Output for 5.3.6
3.2913303375244 us/iteration
Output for 5.3.5
3.3269810676575 us/iteration
Output for 5.3.4
3.3399391174316 us/iteration
Output for 5.3.3
3.3478307723999 us/iteration
Output for 5.3.2
4.2950797080994 us/iteration
Output for 5.3.1
3.3511996269226 us/iteration
Output for 5.3.0
3.5816192626953 us/iteration
Output for 5.2.17
4.3498706817627 us/iteration
Output for 5.2.16
3.7616896629333 us/iteration
Output for 5.2.15
3.5142087936401 us/iteration
Output for 5.2.14
3.4551191329956 us/iteration
Output for 5.2.13
3.5733890533447 us/iteration
Output for 5.2.12
3.5328698158264 us/iteration
Output for 5.2.11
3.5854411125183 us/iteration
Output for 5.2.10
3.6312413215637 us/iteration
Output for 5.2.9
3.5163378715515 us/iteration
Output for 5.2.8
3.6088013648987 us/iteration
Output for 5.2.7
3.6884593963623 us/iteration
Output for 5.2.6
3.4077310562134 us/iteration
Output for 5.2.5
3.8014101982117 us/iteration
Output for 5.2.4
4.0193104743958 us/iteration
Output for 5.2.3
4.0426397323608 us/iteration
Output for 5.2.2
4.1284394264221 us/iteration
Output for 5.2.1
4.9575304985046 us/iteration
Output for 5.2.0
3.8020801544189 us/iteration
Output for 5.1.6
3.601188659668 us/iteration
Output for 5.1.5
3.8319396972656 us/iteration
Output for 5.1.4
3.6652803421021 us/iteration
Output for 5.1.3
3.808069229126 us/iteration
Output for 5.1.2
3.6653399467468 us/iteration
Output for 5.1.1
3.6104488372803 us/iteration
Output for 5.1.0
3.7213611602783 us/iteration
Output for 5.0.0 - 5.0.5
Fatal error: Class 'RuntimeException' not found in /in/3aMgG 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/3aMgG on line 21
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_NEW in /in/3aMgG on line 21
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/3aMgG on line 21
Process exited with code 255.

preferences:
63.57 ms | 711 KiB | 5 Q