3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function foo() { $foo = 'bar'; } $bar = function() { $foo = 'bar'; }; $tries = 1E5; $start = microtime(true); for ($i = 0; $i < $tries; $i++) { foo(); } echo (microtime(true) - $start); $start = microtime(true); for ($i = 0; $i < $tries; $i++) { $bar(); } echo (microtime(true) - $start);
Output for 7.1.0
0.00390887260437010.0053780078887939
Output for 7.0.14
0.0042490959167480.0057308673858643
Output for 7.0.9
0.00272798538208010.0034189224243164
Output for 7.0.8
0.0035328865051270.0044231414794922
Output for 7.0.7
0.00281095504760740.003587007522583
Output for 7.0.6
0.00305581092834470.0032670497894287
Output for 7.0.5
0.00273203849792480.0037598609924316
Output for 7.0.4
0.00370478630065920.0041940212249756
Output for 7.0.3
0.00315904617309570.003838062286377
Output for 7.0.2
0.00390005111694340.0052568912506104
Output for 7.0.1
0.0029931068420410.003788948059082
Output for 7.0.0
0.00349712371826170.0042221546173096
Output for 5.6.28
0.0143301486968990.014081001281738
Output for 5.6.23
0.0229930877685550.021925210952759
Output for 5.6.22
0.0175318717956540.015125036239624
Output for 5.6.21
0.0170218944549560.015964984893799
Output for 5.6.20
0.0136950016021730.014354944229126
Output for 5.6.19
0.0137498378753660.014446973800659
Output for 5.6.18
0.0222728252410890.02026104927063
Output for 5.6.17
0.0178508758544920.015736818313599
Output for 5.6.16
0.0149810314178470.015249967575073
Output for 5.6.15
0.0206289291381840.019075155258179
Output for 5.6.14
0.0220170021057130.021190166473389
Output for 5.6.13
0.0224919319152830.021595001220703
Output for 5.6.12
0.0119090080261230.012693881988525
Output for 5.6.11
0.0121479034423830.012447834014893
Output for 5.6.10
0.0140171051025390.014489889144897
Output for 5.6.9
0.0129401683807370.013270854949951
Output for 5.6.8
0.0185258388519290.018600940704346
Output for 5.6.7
0.0220379829406740.021892070770264
Output for 5.6.6
0.0137889385223390.014877080917358
Output for 5.6.5
0.0203690528869630.020483016967773
Output for 5.6.4
0.0194518566131590.01926589012146
Output for 5.6.3
0.0161790847778320.014516115188599
Output for 5.6.2
0.0204250812530520.0175621509552
Output for 5.6.1
0.0202548503875730.019985914230347
Output for 5.6.0
0.0222930908203120.02175498008728
Output for 5.5.37
0.0177781581878660.014822959899902
Output for 5.5.36
0.014245033264160.015119075775146
Output for 5.5.35
0.0140428543090820.014434099197388
Output for 5.5.34
0.0176110267639160.018206119537354
Output for 5.5.33
0.0226321220397950.020401954650879
Output for 5.5.32
0.0197539329528810.019892930984497
Output for 5.5.31
0.0208280086517330.019234895706177
Output for 5.5.30
0.0150480270385740.014665126800537
Output for 5.5.29
0.0157840251922610.017335891723633
Output for 5.5.28
0.0191760063171390.019497871398926
Output for 5.5.27
0.0220439434051510.021543979644775
Output for 5.5.26
0.0166831016540530.016632080078125
Output for 5.5.25
0.0216310024261470.017184972763062
Output for 5.5.24
0.0134959220886230.014400005340576
Output for 5.5.23
0.0155711174011230.016784906387329
Output for 5.5.22
0.0157899856567380.016145944595337
Output for 5.5.21
0.0214622020721440.021516084671021
Output for 5.5.20
0.0217440128326420.021312952041626
Output for 5.5.19
0.0190999507904050.019585847854614
Output for 5.5.18
0.0183591842651370.018872976303101
Output for 5.5.16
0.0176210403442380.015604019165039
Output for 5.5.15
0.0163199901580810.014358997344971
Output for 5.5.14
0.0135130882263180.014242887496948
Output for 5.5.13
0.0209360122680660.020761966705322
Output for 5.5.12
0.0174689292907710.017333984375
Output for 5.5.11
0.0134878158569340.014520883560181
Output for 5.5.10
0.0233709812164310.022873878479004
Output for 5.5.9
0.0177581310272220.017691850662231
Output for 5.5.8
0.0146040916442870.015007019042969
Output for 5.5.7
0.0168788433074950.017470121383667
Output for 5.5.6
0.0220179557800290.021369934082031
Output for 5.5.5
0.0141859054565430.014281988143921
Output for 5.5.4
0.0135719776153560.014440059661865
Output for 5.5.3
0.0200271606445310.015838146209717
Output for 5.5.2
0.022996902465820.022443056106567
Output for 5.5.1
0.0222370624542240.021119117736816
Output for 5.5.0
0.0211930274963380.02096700668335
Output for 5.4.45
0.0160748958587650.016710996627808
Output for 5.4.44
0.0134608745574950.013396978378296
Output for 5.4.43
0.0126359462738040.013291835784912
Output for 5.4.42
0.0191500186920170.019028902053833
Output for 5.4.41
0.0176830291748050.018209934234619
Output for 5.4.40
0.01902699470520.018325090408325
Output for 5.4.39
0.0176620483398440.017583131790161
Output for 5.4.38
0.0163688659667970.015919923782349
Output for 5.4.37
0.0236659049987790.019311904907227
Output for 5.4.36
0.0194659233093260.019028902053833
Output for 5.4.35
0.0230510234832760.022001981735229
Output for 5.4.34
0.018613100051880.018756151199341
Output for 5.4.32
0.0151209831237790.014297008514404
Output for 5.4.31
0.019194126129150.01983904838562
Output for 5.4.30
0.0171761512756350.014472007751465
Output for 5.4.29
0.0132739543914790.013878107070923
Output for 5.4.28
0.0205471515655520.018543004989624
Output for 5.4.27
0.0151572227478030.015630960464478
Output for 5.4.26
0.0209090709686280.019850015640259
Output for 5.4.25
0.0116159915924070.011905908584595
Output for 5.4.24
0.0205230712890620.018600940704346
Output for 5.4.23
0.014873981475830.014923095703125
Output for 5.4.22
0.0224168300628660.021163940429688
Output for 5.4.21
0.0133728981018070.014256000518799
Output for 5.4.20
0.0223751068115230.021884202957153
Output for 5.4.19
0.0138409137725830.014408826828003
Output for 5.4.18
0.0171930789947510.019701957702637
Output for 5.4.17
0.0215990543365480.021229982376099
Output for 5.4.16
0.0228078365325930.022080898284912
Output for 5.4.15
0.0214138031005860.020610094070435
Output for 5.4.14
0.0211369991302490.020514965057373
Output for 5.4.13
0.0224180221557620.020684003829956
Output for 5.4.12
0.0170841217041020.015639066696167
Output for 5.4.11
0.0200371742248540.019216060638428
Output for 5.4.10
0.0222110748291020.02022385597229
Output for 5.4.9
0.0232009887695310.023896932601929
Output for 5.4.8
0.0227248668670650.019982099533081
Output for 5.4.7
0.0229208469390870.022037982940674
Output for 5.4.6
0.0204010009765620.016700983047485
Output for 5.4.5
0.0188839435577390.018769025802612
Output for 5.4.4
0.0227069854736330.023505926132202
Output for 5.4.3
0.0231730937957760.021566867828369
Output for 5.4.2
0.0179781913757320.017697095870972
Output for 5.4.1
0.018987178802490.018493175506592
Output for 5.4.0
0.0205500125885010.019739151000977
Output for 5.3.29
0.0170559883117680.017734050750732
Output for 5.3.28
0.0234999656677250.021365880966187
Output for 5.3.27
0.0183629989624020.017777919769287
Output for 5.3.26
0.0265159606933590.024407148361206
Output for 5.3.25
0.0253090858459470.023436069488525
Output for 5.3.24
0.0283968448638920.023300886154175
Output for 5.3.23
0.0188450813293460.017850875854492
Output for 5.3.22
0.0266189575195310.023987054824829
Output for 5.3.21
0.022192955017090.018737077713013
Output for 5.3.20
0.0237500667572020.021631956100464
Output for 5.3.19
0.0194540023803710.018218994140625
Output for 5.3.18
0.0280740261077880.022887945175171
Output for 5.3.17
0.0265569686889650.021372079849243
Output for 5.3.16
0.0210440158843990.020167827606201
Output for 5.3.15
0.0264780521392820.02395486831665
Output for 5.3.14
0.0232470035552980.018373012542725
Output for 5.3.13
0.0251579284667970.022949934005737
Output for 5.3.12
0.0261979103088380.024110794067383
Output for 5.3.11
0.0283780097961430.025897979736328
Output for 5.3.10
0.020383119583130.018797159194946
Output for 5.3.9
0.027893066406250.019359827041626
Output for 5.3.8
0.0170381069183350.017096996307373
Output for 5.3.7
0.0262649059295650.024264097213745
Output for 5.3.6
0.0205049514770510.016932010650635
Output for 5.3.5
0.0198330879211430.019081830978394
Output for 5.3.4
0.0209050178527830.019982814788818
Output for 5.3.3
0.027380943298340.021563053131104
Output for 5.3.2
0.0164790153503420.01655912399292
Output for 5.3.1
0.0199890136718750.018967866897583
Output for 5.3.0
0.0178470611572270.017046928405762
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/159dP on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/159dP on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/159dP on line 7
Process exited with code 255.