3v4l.org

run code in 300+ PHP versions simultaneously
<?php const ITERATIONS = 100000; $start = microtime(true); for ($i = 0; $i < ITERATIONS; $i++) { try { throw new Exception($i); } catch (\Throwable $e) { } } $end = microtime(true); $total = $end - $start; echo "Throwing exceptions: $total\n"; $start = microtime(true); for ($i = 0; $i < ITERATIONS; $i++) { new Exception($i); } $end = microtime(true); $total = $end - $start; echo "Creating exceptions: $total\n"; $start = microtime(true); for ($i = 0; $i < ITERATIONS; $i++) { new stdClass(); } $end = microtime(true); $total = $end - $start; echo "Creating stdClass : $total\n"; $start = microtime(true); for ($i = 0; $i < ITERATIONS; $i++) { new Attribute(); } $end = microtime(true); $total = $end - $start; echo "Creating Attribute : $total\n";
Output for 8.4.6
Throwing exceptions: 0.028692007064819 Creating exceptions: 0.014251947402954 Creating stdClass : 0.0025491714477539 Creating Attribute : 0.0034079551696777
Output for 8.4.5
Throwing exceptions: 0.027269840240479 Creating exceptions: 0.014725923538208 Creating stdClass : 0.0024268627166748 Creating Attribute : 0.0040020942687988
Output for 8.4.4
Throwing exceptions: 0.017786026000977 Creating exceptions: 0.014410018920898 Creating stdClass : 0.0024440288543701 Creating Attribute : 0.0033559799194336
Output for 8.4.3
Throwing exceptions: 0.035874128341675 Creating exceptions: 0.013789892196655 Creating stdClass : 0.0023548603057861 Creating Attribute : 0.0034511089324951
Output for 8.4.2
Throwing exceptions: 0.033467054367065 Creating exceptions: 0.014042854309082 Creating stdClass : 0.0023999214172363 Creating Attribute : 0.0035431385040283
Output for 8.4.1
Throwing exceptions: 0.022274017333984 Creating exceptions: 0.014133214950562 Creating stdClass : 0.0024008750915527 Creating Attribute : 0.0034778118133545
Output for 8.3.20
Throwing exceptions: 0.043738842010498 Creating exceptions: 0.020242929458618 Creating stdClass : 0.0022051334381104 Creating Attribute : 0.0031840801239014
Output for 8.3.19
Throwing exceptions: 0.018353939056396 Creating exceptions: 0.01392388343811 Creating stdClass : 0.0021991729736328 Creating Attribute : 0.0032048225402832
Output for 8.3.18
Throwing exceptions: 0.027064085006714 Creating exceptions: 0.01554799079895 Creating stdClass : 0.0022420883178711 Creating Attribute : 0.0033187866210938
Output for 8.3.17
Throwing exceptions: 0.01624584197998 Creating exceptions: 0.013482809066772 Creating stdClass : 0.0021848678588867 Creating Attribute : 0.0032072067260742
Output for 8.3.16
Throwing exceptions: 0.01584792137146 Creating exceptions: 0.013436079025269 Creating stdClass : 0.002216100692749 Creating Attribute : 0.0031628608703613
Output for 8.3.15
Throwing exceptions: 0.016045808792114 Creating exceptions: 0.016227960586548 Creating stdClass : 0.0021939277648926 Creating Attribute : 0.0031840801239014
Output for 8.3.14
Throwing exceptions: 0.015908002853394 Creating exceptions: 0.013652801513672 Creating stdClass : 0.0022208690643311 Creating Attribute : 0.0032467842102051
Output for 8.3.13
Throwing exceptions: 0.016445875167847 Creating exceptions: 0.014063119888306 Creating stdClass : 0.0022552013397217 Creating Attribute : 0.0033059120178223
Output for 8.3.12
Throwing exceptions: 0.031781911849976 Creating exceptions: 0.01363205909729 Creating stdClass : 0.0021770000457764 Creating Attribute : 0.0032780170440674
Output for 8.3.11
Throwing exceptions: 0.041994094848633 Creating exceptions: 0.01938796043396 Creating stdClass : 0.0052070617675781 Creating Attribute : 0.0057909488677979
Output for 8.3.10
Throwing exceptions: 0.033838987350464 Creating exceptions: 0.013714790344238 Creating stdClass : 0.002338171005249 Creating Attribute : 0.0033838748931885
Output for 8.3.9
Throwing exceptions: 0.016273021697998 Creating exceptions: 0.013714075088501 Creating stdClass : 0.0022120475769043 Creating Attribute : 0.0032670497894287
Output for 8.3.8
Throwing exceptions: 0.016343832015991 Creating exceptions: 0.013465881347656 Creating stdClass : 0.0022659301757812 Creating Attribute : 0.0031931400299072
Output for 8.3.7
Throwing exceptions: 0.016125917434692 Creating exceptions: 0.013501882553101 Creating stdClass : 0.0022881031036377 Creating Attribute : 0.0032939910888672
Output for 8.3.6
Throwing exceptions: 0.016211032867432 Creating exceptions: 0.013695955276489 Creating stdClass : 0.0022270679473877 Creating Attribute : 0.0032789707183838
Output for 8.3.5
Throwing exceptions: 0.016510963439941 Creating exceptions: 0.01366400718689 Creating stdClass : 0.0024609565734863 Creating Attribute : 0.0033140182495117
Output for 8.3.4
Throwing exceptions: 0.018671035766602 Creating exceptions: 0.014981985092163 Creating stdClass : 0.0023269653320312 Creating Attribute : 0.00364089012146
Output for 8.3.3
Throwing exceptions: 0.017070055007935 Creating exceptions: 0.013455867767334 Creating stdClass : 0.0022869110107422 Creating Attribute : 0.00325608253479
Output for 8.3.2
Throwing exceptions: 0.017390012741089 Creating exceptions: 0.01331901550293 Creating stdClass : 0.0022890567779541 Creating Attribute : 0.0032238960266113
Output for 8.3.1
Throwing exceptions: 0.016416072845459 Creating exceptions: 0.014217853546143 Creating stdClass : 0.0023360252380371 Creating Attribute : 0.0050151348114014
Output for 8.3.0
Throwing exceptions: 0.015597105026245 Creating exceptions: 0.013489007949829 Creating stdClass : 0.002345085144043 Creating Attribute : 0.0032899379730225
Output for 8.2.28
Throwing exceptions: 0.031893968582153 Creating exceptions: 0.013650894165039 Creating stdClass : 0.0022530555725098 Creating Attribute : 0.0032229423522949
Output for 8.2.27
Throwing exceptions: 0.036054134368896 Creating exceptions: 0.014082908630371 Creating stdClass : 0.0022480487823486 Creating Attribute : 0.0031781196594238
Output for 8.2.26
Throwing exceptions: 0.0157310962677 Creating exceptions: 0.013504028320312 Creating stdClass : 0.0022871494293213 Creating Attribute : 0.0032069683074951
Output for 8.2.25
Throwing exceptions: 0.016329050064087 Creating exceptions: 0.01360297203064 Creating stdClass : 0.0023019313812256 Creating Attribute : 0.0031719207763672
Output for 8.2.24
Throwing exceptions: 0.015805959701538 Creating exceptions: 0.013252019882202 Creating stdClass : 0.0022838115692139 Creating Attribute : 0.0032649040222168
Output for 8.2.23
Throwing exceptions: 0.015755891799927 Creating exceptions: 0.01336407661438 Creating stdClass : 0.0022881031036377 Creating Attribute : 0.0031669139862061
Output for 8.2.22
Throwing exceptions: 0.015998840332031 Creating exceptions: 0.01357102394104 Creating stdClass : 0.0021688938140869 Creating Attribute : 0.0032510757446289
Output for 8.2.21
Throwing exceptions: 0.016119956970215 Creating exceptions: 0.013400077819824 Creating stdClass : 0.0022280216217041 Creating Attribute : 0.0046648979187012
Output for 8.2.20
Throwing exceptions: 0.015825986862183 Creating exceptions: 0.01323413848877 Creating stdClass : 0.0021758079528809 Creating Attribute : 0.0031471252441406
Output for 8.2.19
Throwing exceptions: 0.031805038452148 Creating exceptions: 0.013186931610107 Creating stdClass : 0.0022008419036865 Creating Attribute : 0.0032260417938232
Output for 8.2.18
Throwing exceptions: 0.034844875335693 Creating exceptions: 0.013286113739014 Creating stdClass : 0.0021851062774658 Creating Attribute : 0.0031430721282959
Output for 8.2.17
Throwing exceptions: 0.027206897735596 Creating exceptions: 0.013962030410767 Creating stdClass : 0.0024299621582031 Creating Attribute : 0.0034139156341553
Output for 8.2.16
Throwing exceptions: 0.01810097694397 Creating exceptions: 0.013792991638184 Creating stdClass : 0.0027260780334473 Creating Attribute : 0.0033059120178223
Output for 8.2.15
Throwing exceptions: 0.015825033187866 Creating exceptions: 0.01333212852478 Creating stdClass : 0.0023329257965088 Creating Attribute : 0.0031979084014893
Output for 8.2.14
Throwing exceptions: 0.01528000831604 Creating exceptions: 0.013620138168335 Creating stdClass : 0.0022971630096436 Creating Attribute : 0.0033040046691895
Output for 8.2.13
Throwing exceptions: 0.015239000320435 Creating exceptions: 0.013299942016602 Creating stdClass : 0.00229811668396 Creating Attribute : 0.0032110214233398
Output for 8.2.12
Throwing exceptions: 0.015573024749756 Creating exceptions: 0.013381958007812 Creating stdClass : 0.0022809505462646 Creating Attribute : 0.0033440589904785
Output for 8.2.11
Throwing exceptions: 0.016495943069458 Creating exceptions: 0.01581883430481 Creating stdClass : 0.0023500919342041 Creating Attribute : 0.0032389163970947
Output for 8.2.10
Throwing exceptions: 0.029623031616211 Creating exceptions: 0.013340950012207 Creating stdClass : 0.0023679733276367 Creating Attribute : 0.0033390522003174
Output for 8.2.9
Throwing exceptions: 0.030536890029907 Creating exceptions: 0.013689041137695 Creating stdClass : 0.0024359226226807 Creating Attribute : 0.0032529830932617
Output for 8.2.8
Throwing exceptions: 0.03685188293457 Creating exceptions: 0.013356924057007 Creating stdClass : 0.0023281574249268 Creating Attribute : 0.0036308765411377
Output for 8.2.7
Throwing exceptions: 0.027818918228149 Creating exceptions: 0.013455867767334 Creating stdClass : 0.0023870468139648 Creating Attribute : 0.0032379627227783
Output for 8.2.6
Throwing exceptions: 0.026745080947876 Creating exceptions: 0.014461040496826 Creating stdClass : 0.0023090839385986 Creating Attribute : 0.0033318996429443
Output for 8.2.5
Throwing exceptions: 0.015921115875244 Creating exceptions: 0.013270139694214 Creating stdClass : 0.0024118423461914 Creating Attribute : 0.0033209323883057
Output for 8.2.4
Throwing exceptions: 0.015323877334595 Creating exceptions: 0.013405084609985 Creating stdClass : 0.002316951751709 Creating Attribute : 0.0033738613128662
Output for 8.2.3
Throwing exceptions: 0.030309915542603 Creating exceptions: 0.013620853424072 Creating stdClass : 0.0022718906402588 Creating Attribute : 0.0033130645751953
Output for 8.2.2
Throwing exceptions: 0.031185865402222 Creating exceptions: 0.01397705078125 Creating stdClass : 0.0023300647735596 Creating Attribute : 0.0032541751861572
Output for 8.2.1
Throwing exceptions: 0.028891086578369 Creating exceptions: 0.013293027877808 Creating stdClass : 0.0023059844970703 Creating Attribute : 0.0032861232757568
Output for 8.2.0
Throwing exceptions: 0.015727996826172 Creating exceptions: 0.013646125793457 Creating stdClass : 0.0023009777069092 Creating Attribute : 0.0032651424407959

preferences:
61.1 ms | 487 KiB | 5 Q