3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function count_digits($digit) { // TODO: add type validation return $digit >= 10 ? 1 + count_digits($digit / 10) : 1; } $digit = 1554; $tries = 10000; $start = microtime(true); for ($i = 0; $i < $tries; $i++) { count_digits($digit); } echo (microtime(true) - $start).PHP_EOL; $start = microtime(true); for ($i = 0; $i < $tries; $i++) { strlen($digit); } echo (microtime(true) - $start);
Output for 7.2.0
0.0014369487762451 0.00038409233093262
Output for 7.1.7
0.0012731552124023 0.00033998489379883
Output for 7.1.6
0.0029199123382568 0.00071907043457031
Output for 7.1.5
0.0034198760986328 0.00095701217651367
Output for 7.1.0
0.0013799667358398 0.00043678283691406
Output for 7.0.20
0.0013830661773682 0.00033807754516602
Output for 7.0.14
0.0025119781494141 0.00077509880065918
Output for 7.0.6
0.0014410018920898 0.00037598609924316
Output for 7.0.5
0.0020298957824707 0.0005030632019043
Output for 7.0.4
0.0014030933380127 0.00034999847412109
Output for 7.0.3
0.0018379688262939 0.00051593780517578
Output for 7.0.2
0.0013699531555176 0.0003511905670166
Output for 7.0.1
0.0016219615936279 0.00036215782165527
Output for 7.0.0
0.002100944519043 0.00053501129150391
Output for 5.6.28
0.0087709426879883 0.0027458667755127
Output for 5.6.21
0.0058548450469971 0.001802921295166
Output for 5.6.20
0.0065698623657227 0.0019938945770264
Output for 5.6.19
0.0061161518096924 0.0019059181213379
Output for 5.6.18
0.0057611465454102 0.0016660690307617
Output for 5.6.17
0.0042860507965088 0.0012447834014893
Output for 5.6.16
0.0054409503936768 0.0016160011291504
Output for 5.6.15
0.0049581527709961 0.0014939308166504
Output for 5.6.14
0.004371166229248 0.0012929439544678
Output for 5.6.13
0.007127046585083 0.0019209384918213
Output for 5.6.12
0.004889965057373 0.0015408992767334
Output for 5.6.11
0.0064771175384521 0.0020079612731934
Output for 5.6.10
0.0049200057983398 0.001399040222168
Output for 5.6.9
0.0060360431671143 0.0017499923706055
Output for 5.6.8
0.0066690444946289 0.0018739700317383
Output for 5.6.7
0.0063049793243408 0.0019161701202393
Output for 5.5.35
0.0062270164489746 0.0019800662994385
Output for 5.5.34
0.0040340423583984 0.0012660026550293
Output for 5.5.33
0.0040700435638428 0.0012900829315186
Output for 5.5.32
0.0054900646209717 0.0017709732055664
Output for 5.5.31
0.0058059692382812 0.0018990039825439
Output for 5.5.30
0.0039870738983154 0.0017411708831787
Output for 5.5.29
0.0066261291503906 0.00211501121521
Output for 5.5.28
0.0045120716094971 0.0014259815216064
Output for 5.5.27
0.0060529708862305 0.0020308494567871
Output for 5.5.26
0.005756139755249 0.0019009113311768
Output for 5.5.25
0.0049941539764404 0.0015499591827393
Output for 5.5.24
0.0067698955535889 0.0019991397857666
Output for 5.4.45
0.0059840679168701 0.0032830238342285
Output for 5.4.44
0.0057640075683594 0.0018880367279053
Output for 5.4.43
0.0062990188598633 0.0024878978729248
Output for 5.4.42
0.0069420337677002 0.0019910335540771
Output for 5.4.41
0.0079329013824463 0.0021259784698486
Output for 5.4.40
0.013683080673218 0.012149810791016
Output for 5.4.39
0.011662006378174 0.0038950443267822
Output for 5.4.38
0.010339021682739 0.0036718845367432
Output for 5.4.37
0.0060720443725586 0.0019359588623047
Output for 5.4.36
0.0062980651855469 0.0020899772644043
Output for 5.4.35
0.0098681449890137 0.0026688575744629
Output for 5.4.34
0.005295991897583 0.0017478466033936
Output for 5.4.32
0.0043890476226807 0.0015120506286621
Output for 5.4.31
0.0047597885131836 0.0016300678253174
Output for 5.4.30
0.0042781829833984 0.0013930797576904
Output for 5.4.29
0.0043070316314697 0.0015811920166016
Output for 5.4.28
0.008774995803833 0.0015230178833008
Output for 5.4.27
0.004774808883667 0.0014910697937012
Output for 5.4.26
0.0042891502380371 0.0015459060668945
Output for 5.4.25
0.0068798065185547 0.0019478797912598
Output for 5.4.24
0.011592864990234 0.004774808883667
Output for 5.4.23
0.0063459873199463 0.0027470588684082
Output for 5.4.22
0.0060479640960693 0.0022060871124268
Output for 5.4.21
0.0058979988098145 0.0020442008972168
Output for 5.4.20
0.0078668594360352 0.0019550323486328
Output for 5.4.19
0.01008415222168 0.0036160945892334
Output for 5.4.18
0.0067131519317627 0.0027530193328857
Output for 5.4.17
0.0096950531005859 0.0055370330810547
Output for 5.4.16
0.0063910484313965 0.0027220249176025
Output for 5.4.15
0.0063519477844238 0.0025811195373535
Output for 5.4.14
0.0076711177825928 0.0024969577789307
Output for 5.4.13
0.0076379776000977 0.0019071102142334
Output for 5.4.12
0.0081830024719238 0.0036509037017822
Output for 5.4.11
0.012052059173584 0.00537109375
Output for 5.4.10
0.0075180530548096 0.0022730827331543
Output for 5.4.9
0.0064229965209961 0.0027050971984863
Output for 5.4.8
0.0071048736572266 0.0019698143005371
Output for 5.4.7
0.0065300464630127 0.0022430419921875
Output for 5.4.6
0.0071711540222168 0.0034091472625732
Output for 5.4.5
0.0069608688354492 0.0035018920898438
Output for 5.4.4
0.0069260597229004 0.0018818378448486
Output for 5.4.3
0.011114835739136 0.004439115524292
Output for 5.4.2
0.0079951286315918 0.0028719902038574
Output for 5.4.1
0.0063540935516357 0.0020308494567871
Output for 5.4.0
0.011680126190186 0.0037658214569092
Output for 5.3.29
0.0058181285858154 0.0017271041870117
Output for 5.3.28
0.0084319114685059 0.0039100646972656
Output for 5.3.27
0.014041185379028 0.0042979717254639
Output for 5.3.26
0.0080060958862305 0.0026350021362305
Output for 5.3.25
0.0082409381866455 0.0023629665374756
Output for 5.3.24
0.0085248947143555 0.0027968883514404
Output for 5.3.23
0.013262987136841 0.0039901733398438
Output for 5.3.22
0.014405012130737 0.0055909156799316
Output for 5.3.21
0.0099780559539795 0.0028269290924072
Output for 5.3.20
0.010848045349121 0.0048601627349854
Output for 5.3.19
0.013436079025269 0.0044069290161133
Output for 5.3.18
0.0089139938354492 0.0047619342803955
Output for 5.3.17
0.0080029964447021 0.0035190582275391
Output for 5.3.16
0.0090348720550537 0.0026919841766357
Output for 5.3.15
0.014083862304688 0.0060019493103027
Output for 5.3.14
0.0086121559143066 0.0031130313873291
Output for 5.3.13
0.0090000629425049 0.0028700828552246
Output for 5.3.12
0.0081770420074463 0.0022900104522705
Output for 5.3.11
0.0083019733428955 0.0034999847412109
Output for 5.3.10
0.0088701248168945 0.0031750202178955
Output for 5.3.9
0.00897216796875 0.00341796875
Output for 5.3.8
0.016002893447876 0.0065820217132568
Output for 5.3.7
0.0082061290740967 0.0027079582214355
Output for 5.3.6
0.012111186981201 0.0047259330749512
Output for 5.3.5
0.01367712020874 0.0051009654998779
Output for 5.3.4
0.008181095123291 0.0032749176025391
Output for 5.3.3
0.0084159374237061 0.0026659965515137
Output for 5.3.2
0.0087089538574219 0.0028641223907471
Output for 5.3.1
0.0081160068511963 0.0026929378509521
Output for 5.3.0
0.0092651844024658 0.0027680397033691
Output for 5.2.17
0.02186107635498 0.0047760009765625
Output for 5.2.16
0.012358903884888 0.0028328895568848
Output for 5.2.15
0.01358699798584 0.0042829513549805
Output for 5.2.14
0.018385887145996 0.0041141510009766
Output for 5.2.13
0.014410018920898 0.0027101039886475
Output for 5.2.12
0.012845993041992 0.0029900074005127
Output for 5.2.11
0.023474931716919 0.0048699378967285
Output for 5.2.10
0.01993203163147 0.0053551197052002
Output for 5.2.9
0.015305995941162 0.0026021003723145
Output for 5.2.8
0.015951871871948 0.010302066802979
Output for 5.2.7
0.022215843200684 0.0075969696044922
Output for 5.2.6
0.013263940811157 0.0028021335601807
Output for 5.2.5
0.019443988800049 0.0047199726104736
Output for 5.2.4
0.023042917251587 0.0047991275787354
Output for 5.2.3
0.012883901596069 0.0024290084838867
Output for 5.2.2
0.01290488243103 0.0029151439666748
Output for 5.2.1
0.012976884841919 0.0035049915313721
Output for 5.2.0
0.013898134231567 0.0049831867218018
Output for 5.1.6
0.012537956237793 0.003040075302124
Output for 5.1.5
0.014484167098999 0.0047149658203125
Output for 5.1.4
0.013211965560913 0.0052490234375
Output for 5.1.3
0.023339033126831 0.0038220882415771
Output for 5.1.2
0.013056039810181 0.00335693359375
Output for 5.1.1
0.012212991714478 0.0040988922119141
Output for 5.1.0
0.015424013137817 0.0045239925384521
Output for 5.0.5
0.026136159896851 0.0072879791259766
Output for 5.0.4
0.027230024337769 0.0053789615631104
Output for 5.0.3
0.035810947418213 0.010539054870605
Output for 5.0.2
0.023329973220825 0.00630784034729
Output for 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.025044918060303PHP_EOL0.0066258907318115
Output for 5.0.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.023936033248901PHP_EOL0.0051538944244385
Output for 4.4.9
0.021543 0.005611
Output for 4.4.8
0.023642 0.004944
Output for 4.4.7
0.030185 0.007397
Output for 4.4.6
0.022401 0.005248
Output for 4.4.5
0.026538 0.006479
Output for 4.4.4
0.02658 0.007413
Output for 4.4.3
0.025215 0.00542
Output for 4.4.2
0.023046 0.005119
Output for 4.4.1
0.038604 0.00927
Output for 4.4.0
0.035944 0.009524
Output for 4.3.11
0.04068 0.007991
Output for 4.3.10
0.03627 0.010618
Output for 4.3.9
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.041193PHP_EOL0.00727
Output for 4.3.8
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.024941PHP_EOL0.005842
Output for 4.3.7
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.03976PHP_EOL0.009681
Output for 4.3.6
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.025409PHP_EOL0.005164
Output for 4.3.5
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.024321PHP_EOL0.005566
Output for 4.3.4
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.020957PHP_EOL0.004776
Output for 4.3.3
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.024656PHP_EOL0.006187
Output for 4.3.2
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.023042PHP_EOL0.005352
Output for 4.3.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.021403PHP_EOL0.004878
Output for 4.3.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.022728PHP_EOL0.00523