3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo {} function f0($foo) {} function f1(Foo $foo) {} function f2(Foo $foo = null) {} $calls = 1000000; $avg = 3; $m = array(); for ($j = 0; $j < $avg; $j++) { $start = microtime(true); for ($i = 0; $i < $calls; $i++) { f0(new Foo()); } $m[] = microtime(true) - $start; } var_dump(array_sum($m) / $avg); $m = array(); for ($j = 0; $j < $avg; $j++) { $start = microtime(true); for ($i = 0; $i < $calls; $i++) { f1(new Foo()); } $m[] = microtime(true) - $start; } var_dump(array_sum($m) / $avg); $m = array(); for ($j = 0; $j < $avg; $j++) { $start = microtime(true); for ($i = 0; $i < $calls; $i++) { f2(new Foo()); } $m[] = microtime(true) - $start; } var_dump(array_sum($m) / $avg);
Output for 7.1.0
float(0.01042898495992) float(-0.072043339411418) float(-0.08438769976298)
Output for 7.0.14
float(0.038953940073649) float(-0.086342970530192) float(-0.087752024332682)
Output for 5.6.28
float(0.092800935109456) float(-0.16351898511251) float(0.46060729026794)
Output for 5.4.45
float(0.15423965454102) float(0.19529032707214) float(0.19475237528483)
Output for 5.4.44
float(0.15473961830139) float(0.1970853805542) float(0.19601360956828)
Output for 5.4.43
float(0.15731509526571) float(0.20007467269897) float(0.19741201400757)
Output for 5.4.42
float(0.15620636940002) float(0.19833262761434) float(0.1949524084727)
Output for 5.4.41
float(0.15686702728271) float(0.19670859972636) float(0.19794368743896)
Output for 5.4.40
float(0.15565768877665) float(0.19363363583883) float(0.19474943478902)
Output for 5.4.39
float(0.18479665120443) float(0.24643699328105) float(0.25280658404032)
Output for 5.4.38
float(0.17489655812581) float(0.19912997881571) float(0.19517477353414)
Output for 5.4.37
float(0.15293296178182) float(0.19511644045512) float(0.19514735539754)
Output for 5.4.36
float(0.15764300028483) float(0.19768238067627) float(0.19505031903585)
Output for 5.4.35
float(0.15182797114054) float(0.19473457336426) float(0.19519035021464)
Output for 5.4.34
float(0.1507822672526) float(0.1965012550354) float(0.19717741012573)
Output for 5.4.32
float(0.15465903282166) float(0.19729789098104) float(0.20002198219299)
Output for 5.4.31
float(0.15203865369161) float(0.1963886419932) float(0.19659431775411)
Output for 5.4.30
float(0.16348099708557) float(0.2017617225647) float(0.19660425186157)
Output for 5.4.29
float(0.16230901082357) float(0.19706193606059) float(0.19487524032593)
Output for 5.4.28
float(0.17463334401449) float(0.23838885625203) float(0.24154011408488)
Output for 5.4.27
float(0.16436505317688) float(0.19601329167684) float(0.19523636500041)
Output for 5.4.26
float(0.16677236557007) float(0.2730876604716) float(0.28094498316447)
Output for 5.4.24
float(0.16240731875102) float(0.19862008094788) float(0.19956803321838)
Output for 5.4.23
float(0.15030320485433) float(0.19367869695028) float(0.19440627098083)
Output for 5.4.22
float(0.17300033569336) float(0.21135369936625) float(0.20631806055705)
Output for 5.4.21
float(0.15727273623149) float(0.19214224815369) float(0.19266271591187)
Output for 5.4.20
float(0.16020123163859) float(0.1983167330424) float(0.19746891657511)
Output for 5.4.19
float(0.15132665634155) float(0.19585100809733) float(0.19547454516093)
Output for 5.4.18
float(0.1525042851766) float(0.19727476437887) float(0.19921104113261)
Output for 5.4.17
float(0.1590842405955) float(0.20108731587728) float(0.19795433680216)
Output for 5.4.16
float(0.14938314755758) float(0.19429341952006) float(0.19326631228129)
Output for 5.4.15
float(0.1553750038147) float(0.19630392392476) float(0.19630344708761)
Output for 5.4.14
float(0.15258304278056) float(0.19465565681458) float(0.19406143824259)
Output for 5.4.13
float(0.15916570027669) float(0.19581278165181) float(0.19327966372172)
Output for 5.4.12
float(0.39305233955383) float(0.31755407651265)
Process exited with code 137.
Output for 5.4.11
float(0.15864237149556) float(0.19597069422404) float(0.19186568260193)
Output for 5.4.10
float(0.15670824050903) float(0.1960810025533) float(0.19198393821716)
Output for 5.4.9
float(0.16836110750834) float(0.20531256993612) float(0.2013889948527)
Output for 5.4.8
float(0.17544730504354) float(0.19691809018453) float(0.19312675793966)
Output for 5.4.7
float(0.15760509173075) float(0.19751834869385) float(0.19536399841309)
Output for 5.4.6
float(0.17727430661519) float(0.31532939275106) float(0.31346964836121)
Output for 5.4.5
float(0.15600236256917) float(0.19284160931905) float(0.19388008117676)
Output for 5.4.4
float(0.15318401654561) float(0.1956033706665) float(0.19396662712097)
Output for 5.4.3
float(0.14988072713216) float(0.19334069887797) float(0.19247603416443)
Output for 5.4.2
float(0.15254767735799) float(0.19344067573547) float(0.19472193717957)
Output for 5.4.1
float(0.15988500912984) float(0.1972713470459) float(0.19316307703654)
Output for 5.4.0
float(0.15323034922282) float(0.19502107302348) float(0.19383533795675)
Output for 5.3.29
float(0.23977263768514) float(0.26411199569702) float(0.27272137006124)
Output for 5.3.28
float(0.24922267595927) float(0.26890595753988) float(0.27005672454834)
Output for 5.3.27
float(0.30439964930216) float(0.37332876523336)
Process exited with code 137.
Output for 5.3.26
float(0.24480565388997) float(0.27085900306702) float(0.26846194267273)
Output for 5.3.25
float(0.24532906214396) float(0.27661840120951)
Process exited with code 137.
Output for 5.3.24
float(0.23423027992249) float(0.26834479967753) float(0.2660604317983)
Output for 5.3.23
float(0.24636205037435) float(0.26686358451843) float(0.26612035433451)
Output for 5.3.22
float(0.43382493654887)
Process exited with code 137.
Output for 5.3.21
float(0.23736675580343) float(0.27294794718424) float(0.2726423740387)
Output for 5.3.20
float(0.3582816918691) float(0.44107866287231)
Process exited with code 137.
Output for 5.3.19
float(0.23905762036641) float(0.27007102966309) float(0.2657249768575)
Output for 5.3.18
float(0.23653896649679) float(0.26298069953918) float(0.26525870958964)
Output for 5.3.17
float(0.23967695236206) float(0.25717409451803) float(0.26176063219706)
Output for 5.3.16
float(0.41930492719014)
Process exited with code 137.
Output for 5.3.15
float(0.25401504834493) float(0.27381507555644) float(0.27427172660828)
Output for 5.3.14
float(0.35675883293152) float(0.41682402292887)
Process exited with code 137.
Output for 5.3.13
float(0.25226092338562) float(0.27763867378235)
Process exited with code 137.
Output for 5.3.12
float(0.25655102729797) float(0.2751399676005)
Process exited with code 137.
Output for 5.3.11
float(0.24859340985616) float(0.27504134178162)
Process exited with code 137.
Output for 5.3.10
float(0.24482377370199) float(0.26820826530457) float(0.26795371373494)
Output for 5.3.9
float(0.24234294891357) float(0.28053561846415) float(0.27551364898682)
Output for 5.3.8
float(0.23878200848897) float(0.27039321263631) float(0.26746662457784)
Output for 5.3.7
float(0.23534838358561) float(0.27301732699076) float(0.27021431922913)
Output for 5.3.6
float(0.3856209119161) float(0.41469931602478)
Process exited with code 137.
Output for 5.3.5
float(0.33854691187541) float(0.39515336354574)
Process exited with code 137.
Output for 5.3.4
float(0.24494544665019) float(0.27231399218241)
Process exited with code 137.
Output for 5.3.3
float(0.38090435663859) float(0.40779638290405)
Process exited with code 137.
Output for 5.3.2
float(0.24164207776388) float(0.26808134714762)
Process exited with code 137.
Output for 5.3.1
float(0.24929197629293) float(0.26979200045268) float(0.27111601829529)
Output for 5.3.0
float(0.24831891059875) float(0.27714935938517) float(0.2726476987203)