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 = 1; $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.061933994293213) float(0.071568012237549) float(0.085498094558716)
Output for 7.0.14
float(0.11322498321533) float(-0.003770112991333) float(-0.087230205535889)
Output for 7.0.10
float(0.11508393287659) float(0.089453935623169) float(0.076266050338745)
Output for 7.0.9
float(0.11302614212036) float(0.075701236724854) float(0.073239088058472)
Output for 7.0.8
float(0.081215858459473) float(0.081530809402466) float(0.080334901809692)
Output for 7.0.7
float(0.078409194946289) float(0.07848596572876) float(0.076333999633789)
Output for 7.0.6
float(0.075956106185913) float(0.07525897026062) float(0.074179172515869)
Output for 7.0.5
float(0.074526071548462) float(0.07374095916748) float(0.074254035949707)
Output for 7.0.4
float(0.093029975891113) float(0.080398082733154) float(0.081140995025635)
Output for 7.0.3
float(0.076815128326416) float(0.072683095932007) float(0.074720144271851)
Output for 7.0.2
float(0.082324028015137) float(0.075670003890991) float(0.074748992919922)
Output for 7.0.1
float(0.076472997665405) float(0.082687854766846) float(0.078848123550415)
Output for 7.0.0
float(0.096687078475952) float(0.084710121154785) float(0.074455976486206)
Output for hhvm-3.12.0
float(0.28192114830017) float(0.36863613128662) float(0.40966892242432)
Output for hhvm-3.10.0
float(0.43875622749329) float(0.46859097480774) float(0.46675801277161)
Output for 5.6.28
float(0.18721199035645) float(0.14472389221191) float(-0.21728301048279)
Output for 5.6.25
float(0.21188020706177) float(0.24268412590027) float(0.2454469203949)
Output for 5.6.24
float(0.21500110626221) float(0.24193692207336) float(0.24474310874939)
Output for 5.6.23
float(0.18037009239197) float(0.24315500259399) float(0.24315404891968)
Output for 5.6.22
float(0.17398715019226) float(0.24171614646912) float(0.24192500114441)
Output for 5.6.21
float(0.17000699043274) float(0.24334692955017) float(0.24481391906738)
Output for 5.6.20
float(0.17554092407227) float(0.25118613243103) float(0.25274801254272)
Output for 5.6.19
float(0.17071604728699) float(0.24928593635559) float(0.26149082183838)
Output for 5.6.18
float(0.16907906532288) float(0.25041913986206) float(0.24730205535889)
Output for 5.6.17
float(0.1557309627533) float(0.24408602714539) float(0.24833202362061)
Output for 5.6.16
float(0.15998506546021) float(0.242103099823) float(0.24603796005249)
Output for 5.6.15
float(0.17018103599548) float(0.2632851600647) float(0.25373888015747)
Output for 5.6.14
float(0.15855193138123) float(0.25089502334595) float(0.25239610671997)
Output for 5.6.13
float(0.18711614608765) float(0.24938797950745) float(0.24570202827454)
Output for 5.6.12
float(0.18754887580872) float(0.243980884552) float(0.24499893188477)
Output for 5.6.11
float(0.1741099357605) float(0.24844908714294) float(0.24939513206482)
Output for 5.6.10
float(0.15458488464355) float(0.24669480323792) float(0.24621605873108)
Output for 5.6.9
float(0.18549704551697) float(0.25088596343994) float(0.24998712539673)
Output for 5.6.8
float(0.16649794578552) float(0.23650884628296) float(0.24255084991455)
Output for 5.6.7
float(0.1708550453186) float(0.24564909934998) float(0.2458348274231)
Output for 5.6.6
float(0.15274119377136) float(0.24572491645813) float(0.20823097229004)
Output for 5.6.5
float(0.15535998344421) float(0.22032713890076) float(0.20314002037048)
Output for 5.6.4
float(0.15366196632385) float(0.2256600856781) float(0.20288491249084)
Output for 5.6.3
float(0.16920590400696) float(0.24338102340698) float(0.24396705627441)
Output for 5.6.2
float(0.19737696647644) float(0.26256203651428) float(0.26206278800964)
Output for 5.6.1
float(0.18145203590393) float(0.24288010597229) float(0.24216079711914)
Output for 5.6.0
float(0.18751811981201) float(0.24341607093811) float(0.24224400520325)
Output for 5.5.38
float(0.16899108886719) float(0.25008392333984) float(0.24959588050842)
Output for 5.5.37
float(0.22693395614624) float(0.26075983047485) float(0.26658797264099)
Output for 5.5.36
float(0.16724801063538) float(0.25296711921692) float(0.24556612968445)
Output for 5.5.35
float(0.15710592269897) float(0.21732902526855) float(0.20866394042969)
Output for 5.5.34
float(0.19075012207031) float(0.25255990028381) float(0.25297498703003)
Output for 5.5.33
float(0.19199705123901) float(0.25170588493347) float(0.24865794181824)
Output for 5.5.32
float(0.15883803367615) float(0.25096392631531) float(0.25221395492554)
Output for 5.5.31
float(0.17358899116516) float(0.25450587272644) float(0.25537395477295)
Output for 5.5.30
float(0.15783309936523) float(0.25095105171204) float(0.24793601036072)
Output for 5.5.29
float(0.16304397583008) float(0.25074219703674) float(0.25159287452698)
Output for 5.5.28
float(0.17464399337769) float(0.25004196166992) float(0.2530369758606)
Output for 5.5.27
float(0.16608095169067) float(0.24540996551514) float(0.25144910812378)
Output for 5.5.26
float(0.1750180721283) float(0.2496190071106) float(0.25235486030579)
Output for 5.5.25
float(0.15508389472961) float(0.27319097518921) float(0.25203704833984)
Output for 5.5.24
float(0.17000699043274) float(0.24988603591919) float(0.251384973526)
Output for 5.5.23
float(0.17796802520752) float(0.25452995300293) float(0.25204396247864)
Output for 5.5.22
float(0.15553188323975) float(0.24423384666443) float(0.20759010314941)
Output for 5.5.21
float(0.16892504692078) float(0.26710891723633) float(0.24528312683105)
Output for 5.5.20
float(0.18006014823914) float(0.2596321105957) float(0.21690678596497)
Output for 5.5.19
float(0.19378185272217) float(0.25372791290283) float(0.25595116615295)
Output for 5.5.18
float(0.16897511482239) float(0.24897193908691) float(0.24926686286926)
Output for 5.5.16
float(0.18896484375) float(0.25022101402283) float(0.24791717529297)
Output for 5.5.15
float(0.17591905593872) float(0.25376796722412) float(0.25430798530579)
Output for 5.5.14
float(0.16615796089172) float(0.25261998176575) float(0.25298595428467)
Output for 5.5.13
float(0.18100810050964) float(0.25301599502563) float(0.26950693130493)
Output for 5.5.12
float(0.1835789680481) float(0.25394797325134) float(0.25078392028809)
Output for 5.5.11
float(0.19879484176636) float(0.25050401687622) float(0.25124216079712)
Output for 5.5.10
float(0.18396496772766) float(0.25546312332153) float(0.25325202941895)
Output for 5.5.9
float(0.18654084205627) float(0.25192093849182) float(0.2499361038208)
Output for 5.5.8
float(0.18149781227112) float(0.25779294967651) float(0.25243282318115)
Output for 5.5.7
float(0.16634297370911) float(0.25400996208191) float(0.25367403030396)
Output for 5.5.6
float(0.18049693107605) float(0.25473594665527) float(0.25155591964722)
Output for 5.5.5
float(0.20212292671204) float(0.27894306182861) float(0.25291800498962)
Output for 5.5.4
float(0.19183397293091) float(0.25409412384033) float(0.2528920173645)
Output for 5.5.3
float(0.18371605873108) float(0.2543420791626) float(0.25837898254395)
Output for 5.5.2
float(0.16068816184998) float(0.25305795669556) float(0.24086880683899)
Output for 5.5.1
float(0.16935205459595) float(0.25005984306335) float(0.2512412071228)
Output for 5.5.0
float(0.17113995552063) float(0.25509405136108) float(0.25576686859131)
Output for 5.4.45
float(0.19057393074036) float(0.2541389465332) float(0.25361204147339)
Output for 5.4.44
float(0.17387008666992) float(0.25535988807678) float(0.25334811210632)
Output for 5.4.43
float(0.16357517242432) float(0.26129102706909) float(0.25578784942627)
Output for 5.4.42
float(0.17221593856812) float(0.25261116027832) float(0.25562882423401)
Output for 5.4.41
float(0.1949679851532) float(0.25618410110474) float(0.25663781166077)
Output for 5.4.40
float(0.16918802261353) float(0.25227403640747) float(0.2483959197998)
Output for 5.4.39
float(0.19360518455505) float(0.25587177276611) float(0.25525784492493)
Output for 5.4.38
float(0.15714502334595) float(0.25890183448792) float(0.24108600616455)
Output for 5.4.37
float(0.15128493309021) float(0.27737712860107) float(0.26835823059082)
Output for 5.4.36
float(0.17900800704956) float(0.28054308891296) float(0.21578693389893)
Output for 5.4.35
float(0.18338394165039) float(0.26588702201843) float(0.25509119033813)
Output for 5.4.34
float(0.18029499053955) float(0.25438094139099) float(0.25371503829956)
Output for 5.4.32
float(0.17679309844971) float(0.25256109237671) float(0.25661206245422)
Output for 5.4.31
float(0.19494891166687) float(0.25855612754822) float(0.29169416427612)
Output for 5.4.30
float(0.16624808311462) float(0.26197719573975) float(0.27203989028931)
Output for 5.4.29
float(0.19190001487732) float(0.21442890167236) float(0.20910477638245)
Output for 5.4.28
float(0.16304898262024) float(0.25748991966248) float(0.25445699691772)
Output for 5.4.27
float(0.17387413978577) float(0.26886510848999) float(0.27365493774414)
Output for 5.4.26
float(0.18013215065002) float(0.25151681900024) float(0.25474905967712)
Output for 5.4.25
float(0.18129992485046) float(0.25604295730591) float(0.25904488563538)
Output for 5.4.24
float(0.16626405715942) float(0.28745698928833) float(0.27047300338745)
Output for 5.4.23
float(0.16789603233337) float(0.25437498092651) float(0.25329899787903)
Output for 5.4.22
float(0.17844486236572) float(0.24810290336609) float(0.25070214271545)
Output for 5.4.21
float(0.16226696968079) float(0.26214003562927) float(0.25523114204407)
Output for 5.4.20
float(0.19072198867798) float(0.2521870136261) float(0.25090789794922)
Output for 5.4.19
float(0.15623211860657) float(0.2192850112915) float(0.20790314674377)
Output for 5.4.18
float(0.15727996826172) float(0.25474500656128) float(0.25389194488525)
Output for 5.4.17
float(0.19146013259888) float(0.21759295463562) float(0.21285009384155)
Output for 5.4.16
float(0.18368697166443) float(0.25276589393616) float(0.25503015518188)
Output for 5.4.15
float(0.17815589904785) float(0.25472092628479) float(0.2549409866333)
Output for 5.4.14
float(0.19556307792664) float(0.25511312484741) float(0.2515869140625)
Output for 5.4.13
float(0.15373206138611) float(0.20827579498291) float(0.2080671787262)
Output for 5.4.12
float(0.16319012641907) float(0.27069592475891) float(0.29161095619202)
Output for 5.4.11
float(0.19746589660645) float(0.21581983566284) float(0.20930814743042)
Output for 5.4.10
float(0.17181301116943) float(0.25667214393616) float(0.25890684127808)
Output for 5.4.9
float(0.17345094680786) float(0.2564389705658) float(0.26380205154419)
Output for 5.4.8
float(0.17250418663025) float(0.27277398109436) float(0.23006200790405)
Output for 5.4.7
float(0.15656399726868) float(0.28048396110535) float(0.27350997924805)
Output for 5.4.6
float(0.15006899833679) float(0.24480700492859) float(0.24797797203064)
Output for 5.4.5
float(0.16061615943909) float(0.25440192222595) float(0.25655889511108)
Output for 5.4.4
float(0.17685103416443) float(0.25569796562195) float(0.25249600410461)
Output for 5.4.3
float(0.19610095024109) float(0.25191807746887) float(0.25103092193604)
Output for 5.4.2
float(0.1940131187439) float(0.25266003608704) float(0.25064587593079)
Output for 5.4.1
float(0.17399096488953) float(0.2541778087616) float(0.25129294395447)
Output for 5.4.0
float(0.17851996421814) float(0.25794386863708) float(0.2557327747345)
Output for 5.3.29
float(0.33763599395752) float(0.35359716415405) float(0.30890512466431)
Output for 5.3.28
float(0.38122510910034) float(0.37675189971924) float(0.36172389984131)
Output for 5.3.27
float(0.36300301551819) float(0.38069295883179) float(0.32910490036011)
Output for 5.3.26
float(0.37521004676819) float(0.38486790657043) float(0.35007905960083)
Output for 5.3.25
float(0.37582802772522) float(0.38048410415649) float(0.34856009483337)
Output for 5.3.24
float(0.36089682579041) float(0.38239693641663) float(0.33186388015747)
Output for 5.3.23
float(0.3210871219635) float(0.31667685508728) float(0.3155689239502)
Output for 5.3.22
float(0.42101407051086) float(0.40002703666687) float(0.32138085365295)
Output for 5.3.21
float(0.39342999458313) float(0.40196180343628) float(0.34465789794922)
Output for 5.3.20
float(0.38162422180176) float(0.41289496421814) float(0.31514000892639)
Output for 5.3.19
float(0.3516149520874) float(0.38449597358704) float(0.31753396987915)
Output for 5.3.18
float(0.35123705863953) float(0.33940982818604) float(0.32439303398132)
Output for 5.3.17
float(0.34413909912109) float(0.36449813842773) float(0.31085991859436)
Output for 5.3.16
float(0.35610198974609) float(0.38450598716736) float(0.32588195800781)
Output for 5.3.15
float(0.36799192428589) float(0.38844394683838) float(0.3274610042572)
Output for 5.3.14
float(0.36316299438477) float(0.38087296485901) float(0.34037899971008)
Output for 5.3.13
float(0.38135504722595) float(0.38687491416931) float(0.36412286758423)
Output for 5.3.12
float(0.33871698379517) float(0.3742880821228) float(0.36767601966858)
Output for 5.3.11
float(0.36408114433289) float(0.39197707176208) float(0.32527494430542)
Output for 5.3.10
float(0.35998201370239) float(0.41678786277771) float(0.36929607391357)
Output for 5.3.9
float(0.36660194396973) float(0.38491916656494) float(0.3213529586792)
Output for 5.3.8
float(0.37712788581848) float(0.40655183792114) float(0.31713199615479)
Output for 5.3.7
float(0.35953307151794) float(0.38470005989075) float(0.32075691223145)
Output for 5.3.6
float(0.37452101707458) float(0.38671398162842) float(0.36692094802856)
Output for 5.3.5
float(0.37476801872253) float(0.39448881149292) float(0.34343099594116)
Output for 5.3.4
float(0.39424300193787) float(0.38776707649231) float(0.3746018409729)
Output for 5.3.3
float(0.36746001243591) float(0.38486289978027) float(0.32265114784241)
Output for 5.3.2
float(0.3798828125) float(0.39417409896851) float(0.32608699798584)
Output for 5.3.1
float(0.36801791191101) float(0.38926100730896) float(0.33020210266113)
Output for 5.3.0
float(0.39531397819519) float(0.42215013504028) float(0.33360004425049)
Output for 5.2.17
float(0.41593909263611) float(0.47143006324768) float(0.39726495742798)
Output for 5.2.16
float(0.41172981262207) float(0.47188186645508) float(0.39895701408386)
Output for 5.2.15
float(0.32796382904053) float(0.39557313919067) float(0.3971061706543)
Output for 5.2.14
float(0.4272198677063) float(0.47641491889954) float(0.39818787574768)
Output for 5.2.13
float(0.42705702781677) float(0.47656393051147) float(0.39600610733032)
Output for 5.2.12
float(0.45174098014832) float(0.48724913597107) float(0.42813086509705)
Output for 5.2.11
float(0.37120008468628) float(0.41041803359985) float(0.39269304275513)
Output for 5.2.10
float(0.44303798675537) float(0.48182010650635) float(0.42360091209412)
Output for 5.2.9
float(0.43964004516602) float(0.48183393478394) float(0.41738700866699)
Output for 5.2.8
float(0.42997813224792) float(0.48075103759766) float(0.40889096260071)
Output for 5.2.7
float(0.42111802101135) float(0.47804403305054) float(0.39831590652466)
Output for 5.2.6
float(0.43160104751587) float(0.4932861328125) float(0.39688301086426)
Output for 5.2.5
float(0.41458106040955) float(0.44994902610779) float(0.39305210113525)
Output for 5.2.4
float(0.41495299339294) float(0.45843911170959) float(0.39804482460022)
Output for 5.2.3
float(0.40803217887878) float(0.40137410163879) float(0.40032482147217)
Output for 5.2.2
float(0.43778395652771) float(0.4896879196167) float(0.41910290718079)
Output for 5.2.1
float(0.4273579120636) float(0.48360586166382) float(0.41003394126892)
Output for 5.2.0
float(0.40142393112183) float(0.43599104881287) float(0.39237189292908)
Output for 5.1.6
float(0.40344500541687) float(0.45995807647705) float(0.40316295623779)
Output for 5.1.5
float(0.39851403236389) float(0.43593311309814) float(0.39358496665955)
Output for 5.1.4
float(0.4110279083252) float(0.46675896644592) float(0.40572690963745)
Output for 5.1.3
float(0.35176491737366) float(0.37882804870605) float(0.40870690345764)
Output for 5.1.2
float(0.3691668510437) float(0.38411211967468) float(0.37575316429138)
Output for 5.1.1
float(0.30241894721985) float(0.37450909614563) float(0.39196300506592)
Output for 5.1.0
float(0.39551901817322) float(0.45248198509216) float(0.37935280799866)
Output for 5.0.5
float(0.5757429599762) float(0.49602079391479) float(0.45650601387024)
Output for 5.0.4
float(0.56157207489014) float(0.52131319046021) float(0.44830107688904)
Output for 5.0.3
float(0.52630209922791) float(0.48407220840454) float(0.4415180683136)
Output for 5.0.2
float(0.51062488555908) float(0.44741702079773) float(0.44764304161072)
Output for 5.0.1
float(0.53110313415527) float(0.48580098152161) float(0.44073295593262)
Output for 5.0.0
float(0.56074810028076) float(0.53215384483337) float(0.45374703407288)
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting ')' in /in/H6RQq on line 5
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_STRING, expecting ')' in /in/H6RQq on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/H6RQq on line 5
Process exited with code 255.