3v4l.org

run code in 150+ 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); $start = microtime(true); for ($i = 0; $i < $tries; $i++) { strlen($digit); } echo (microtime(true) - $start);
Output for 7.1.0
0.00134301185607910.00044608116149902
Output for 7.0.14
0.00249099731445310.00077915191650391
Output for 7.0.6
0.00224995613098140.00054597854614258
Output for 7.0.5
0.00136113166809080.00034499168395996
Output for 7.0.4
0.0017018318176270.00043892860412598
Output for 7.0.3
0.0013499259948730.00034308433532715
Output for 7.0.2
0.00173401832580570.00040388107299805
Output for 7.0.1
0.00184702873229980.00047087669372559
Output for 7.0.0
0.0013239383697510.00034093856811523
Output for 5.6.28
0.00779986381530760.0022931098937988
Output for 5.6.21
0.0102629661560060.0021059513092041
Output for 5.6.20
0.00624585151672360.0012710094451904
Output for 5.6.19
0.00797414779663090.0024919509887695
Output for 5.6.18
0.00583291053771970.0017428398132324
Output for 5.6.17
0.00611805915832520.0012180805206299
Output for 5.6.16
0.00641894340515140.0012791156768799
Output for 5.6.15
0.0099558830261230.002068042755127
Output for 5.6.14
0.00928997993469240.0018620491027832
Output for 5.6.13
0.00964212417602540.0017859935760498
Output for 5.6.12
0.006674051284790.001349925994873
Output for 5.6.11
0.0102260112762450.0019168853759766
Output for 5.6.10
0.00983500480651860.0019080638885498
Output for 5.6.9
0.00617408752441410.0012421607971191
Output for 5.6.8
0.0064439773559570.0012409687042236
Output for 5.6.7
0.00953698158264160.0019431114196777
Output for 5.5.35
0.00982379913330080.0019650459289551
Output for 5.5.34
0.00614094734191890.001270055770874
Output for 5.5.33
0.00537896156311040.0015280246734619
Output for 5.5.32
0.0156369209289550.0030190944671631
Output for 5.5.31
0.010253906250.0027439594268799
Output for 5.5.30
0.00604414939880370.0012848377227783
Output for 5.5.29
0.00997400283813480.0020301342010498
Output for 5.5.28
0.00707101821899410.0013790130615234
Output for 5.5.27
0.00983500480651860.0020270347595215
Output for 5.5.26
0.0082538127899170.0017468929290771
Output for 5.5.25
0.0102610588073730.0019900798797607
Output for 5.5.24
0.00898718833923340.0018799304962158
Output for 5.4.45
0.00694990158081050.0023140907287598
Output for 5.4.44
0.00591897964477540.0018830299377441
Output for 5.4.43
0.00636506080627440.0025978088378906
Output for 5.4.42
0.00651407241821290.0023770332336426
Output for 5.4.41
0.00585818290710450.0018520355224609
Output for 5.4.40
0.0121262073516850.0019738674163818
Output for 5.4.39
0.0150687694549560.0020079612731934
Output for 5.4.38
0.00582289695739750.0019137859344482
Output for 5.4.37
0.00642108917236330.0020108222961426
Output for 5.4.36
0.00658202171325680.002007007598877
Output for 5.4.35
0.00479698181152340.0015289783477783
Output for 5.4.34
0.00482296943664550.0017881393432617
Output for 5.4.32
0.00456809997558590.0013999938964844
Output for 5.4.31
0.0046691894531250.0015630722045898
Output for 5.4.30
0.00433397293090820.0014760494232178
Output for 5.4.29
0.00426387786865230.0014760494232178
Output for 5.4.28
0.00645112991333010.0026481151580811
Output for 5.4.27
0.00469803810119630.0014381408691406
Output for 5.4.26
0.00466609001159670.0014870166778564
Output for 5.4.25
0.00465416908264160.0016829967498779
Output for 5.4.24
0.00461697578430180.0014770030975342
Output for 5.4.23
0.00447797775268550.0015549659729004
Output for 5.4.22
0.00476908683776860.0014770030975342
Output for 5.4.21
0.00489091873168950.0016958713531494
Output for 5.4.20
0.0054979324340820.0024011135101318
Output for 5.4.19
0.00900602340698240.0032989978790283
Output for 5.4.18
0.00487709045410160.0015590190887451
Output for 5.4.17
0.00710892677307130.0030391216278076
Output for 5.4.16
0.00909495353698730.0027379989624023
Output for 5.4.15
0.00468301773071290.0014619827270508
Output for 5.4.14
0.00480103492736820.0016219615936279
Output for 5.4.13
0.00469708442687990.0020320415496826
Output for 5.4.12
0.0046010017395020.0015621185302734
Output for 5.4.11
0.00864410400390620.0029699802398682
Output for 5.4.10
0.00606918334960940.0016078948974609
Output for 5.4.9
0.00539207458496090.0017380714416504
Output for 5.4.8
0.00476694107055660.0017101764678955
Output for 5.4.7
0.00790810585021970.0026648044586182
Output for 5.4.6
0.00801014900207520.0027790069580078
Output for 5.4.5
0.00508213043212890.0017950534820557
Output for 5.4.4
0.00820708274841310.0016181468963623
Output for 5.4.3
0.00845718383789060.0028538703918457
Output for 5.4.2
0.00787281990051270.0035600662231445
Output for 5.4.1
0.00777292251586910.0015439987182617
Output for 5.4.0
0.00812888145446780.0031659603118896
Output for 5.3.29
0.00595903396606450.0016810894012451
Output for 5.3.28
0.00992107391357420.0030109882354736
Output for 5.3.27
0.0102679729461670.0032148361206055
Output for 5.3.26
0.0103321075439450.0032110214233398
Output for 5.3.25
0.012881040573120.0065920352935791
Output for 5.3.24
0.0064251422882080.0019209384918213
Output for 5.3.23
0.00693798065185550.0022299289703369
Output for 5.3.22
0.0100820064544680.0031871795654297
Output for 5.3.21
0.00979399681091310.0037088394165039
Output for 5.3.20
0.00794100761413570.0018289089202881
Output for 5.3.19
0.00549507141113280.001723051071167
Output for 5.3.18
0.00545406341552730.0016641616821289
Output for 5.3.17
0.00876712799072270.0021231174468994
Output for 5.3.16
0.0120759010314940.0040500164031982
Output for 5.3.15
0.00612306594848630.0017139911651611
Output for 5.3.14
0.00624299049377440.0031208992004395
Output for 5.3.13
0.00627994537353520.0017890930175781
Output for 5.3.12
0.0104880332946780.0031659603118896
Output for 5.3.11
0.010246038436890.0031499862670898
Output for 5.3.10
0.01022195816040.0032219886779785
Output for 5.3.9
0.00586581230163570.001676082611084
Output for 5.3.8
0.00591492652893070.0016779899597168
Output for 5.3.7
0.0058970451354980.0016529560089111
Output for 5.3.6
0.00600004196166990.001859188079834
Output for 5.3.5
0.00590610504150390.0022261142730713
Output for 5.3.4
0.00653195381164550.0022211074829102
Output for 5.3.3
0.00690984725952150.0022358894348145
Output for 5.3.2
0.00639486312866210.0021028518676758
Output for 5.3.1
0.0103650093078610.0033581256866455
Output for 5.3.0
0.00829505920410160.003338098526001
Output for 5.2.17
0.0208210945129390.0044598579406738
Output for 5.2.16
0.016566991806030.0037281513214111
Output for 5.2.15
0.0180461406707760.0041401386260986
Output for 5.2.14
0.00923395156860350.0019381046295166
Output for 5.2.13
0.0177810192108150.0033049583435059
Output for 5.2.12
0.0183439254760740.0039470195770264
Output for 5.2.11
0.0153310298919680.0036780834197998
Output for 5.2.10
0.00917792320251460.0018520355224609
Output for 5.2.9
0.0100479125976560.0017688274383545
Output for 5.2.8
0.0119090080261230.0023658275604248
Output for 5.2.7
0.00958991050720210.001708984375
Output for 5.2.6
0.00957918167114260.002129077911377
Output for 5.2.5
0.0107300281524660.0017521381378174
Output for 5.2.4
0.00906395912170410.00187087059021
Output for 5.2.3
0.0105328559875490.0019831657409668
Output for 5.2.2
0.00891304016113280.0017621517181396
Output for 5.2.1
0.0100069046020510.0023632049560547
Output for 5.2.0
0.0137901306152340.0036349296569824
Output for 5.1.6
0.00990295410156250.002363920211792
Output for 5.1.5
0.00962090492248540.0021800994873047
Output for 5.1.4
0.0111291408538820.0022530555725098
Output for 5.1.3
0.0099840164184570.0022909641265869
Output for 5.1.2
0.00968003273010250.0021591186523438
Output for 5.1.1
0.0182218551635740.0036318302154541
Output for 5.1.0
0.014268875122070.0037410259246826
Output for 5.0.5
0.0189909934997560.0042119026184082
Output for 5.0.4
0.0174920558929440.0045299530029297
Output for 5.0.3
0.0154960155487060.004417896270752
Output for 5.0.2
0.0161209106445310.0042288303375244
Output for 5.0.1
0.0148990154266360.0037908554077148
Output for 5.0.0
0.0179488658905030.0040650367736816
Output for 4.4.9
0.0166190.003922
Output for 4.4.8
0.0173770.003865
Output for 4.4.7
0.0185470.003917
Output for 4.4.6
0.0160250.004141
Output for 4.4.5
0.0233880.005468
Output for 4.4.4
0.0198110.004452
Output for 4.4.3
0.0186160.005795
Output for 4.4.2
0.016950.003881
Output for 4.4.1
0.0176680.003916
Output for 4.4.0
0.0204060.003703
Output for 4.3.11
0.0174870.0041909999999999
Output for 4.3.10
0.0168080.003918
Output for 4.3.9
0.0164940.003619
Output for 4.3.8
0.018022-0.996347
Output for 4.3.7
0.0178730.003969
Output for 4.3.6
0.0176850.003695
Output for 4.3.5
0.0162980.003984
Output for 4.3.4
0.0178290.004067
Output for 4.3.3
0.0169420.004225
Output for 4.3.2
0.01830.003964
Output for 4.3.1
0.0163950.003967
Output for 4.3.0
0.0216220.005574