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).PHP_EOL; $start = microtime(true); for ($i = 0; $i < $tries; $i++) { strlen($digit); } echo (microtime(true) - $start);
Output for 7.1.0
0.0013799667358398 0.00043678283691406
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 hhvm-3.12.0
0.005061149597168 0.00083303451538086
Output for hhvm-3.10.0
0.0065138339996338 0.00092315673828125
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.0045521259307861 0.001478910446167
Output for 5.4.24
0.0047249794006348 0.0015749931335449
Output for 5.4.23
0.004439115524292 0.0015079975128174
Output for 5.4.22
0.0051150321960449 0.0017609596252441
Output for 5.4.21
0.0050580501556396 0.0016651153564453
Output for 5.4.20
0.0054810047149658 0.0016660690307617
Output for 5.4.19
0.0050969123840332 0.0017299652099609
Output for 5.4.18
0.0050160884857178 0.0016789436340332
Output for 5.4.17
0.004504919052124 0.0014948844909668
Output for 5.4.16
0.005295991897583 0.0015690326690674
Output for 5.4.15
0.0043818950653076 0.0014510154724121
Output for 5.4.14
0.0045380592346191 0.0015618801116943
Output for 5.4.13
0.0047731399536133 0.0015830993652344
Output for 5.4.12
0.0044159889221191 0.0015389919281006
Output for 5.4.11
0.0067307949066162 0.0017030239105225
Output for 5.4.10
0.0053129196166992 0.0016090869903564
Output for 5.4.9
0.0049848556518555 0.0015730857849121
Output for 5.4.8
0.0044558048248291 0.001554012298584
Output for 5.4.7
0.0046119689941406 0.0018551349639893
Output for 5.4.6
0.0052008628845215 0.0018520355224609
Output for 5.4.5
0.0047500133514404 0.0016350746154785
Output for 5.4.4
0.0045790672302246 0.0015859603881836
Output for 5.4.3
0.0042088031768799 0.0014810562133789
Output for 5.4.2
0.0049622058868408 0.00164794921875
Output for 5.4.1
0.0042791366577148 0.0017080307006836
Output for 5.4.0
0.0044839382171631 0.0015890598297119
Output for 5.3.29
0.0058181285858154 0.0017271041870117
Output for 5.3.28
0.0060021877288818 0.001737117767334
Output for 5.3.27
0.0056807994842529 0.0016889572143555
Output for 5.3.26
0.0055108070373535 0.0016798973083496
Output for 5.3.25
0.0056359767913818 0.0017499923706055
Output for 5.3.24
0.0061218738555908 0.0016410350799561
Output for 5.3.23
0.005706787109375 0.0017271041870117
Output for 5.3.22
0.0065410137176514 0.0020489692687988
Output for 5.3.21
0.0059239864349365 0.0017158985137939
Output for 5.3.20
0.0061149597167969 0.0019488334655762
Output for 5.3.19
0.0057468414306641 0.0018379688262939
Output for 5.3.18
0.006234884262085 0.0016710758209229
Output for 5.3.17
0.006166934967041 0.0017130374908447
Output for 5.3.16
0.0073959827423096 0.0017378330230713
Output for 5.3.15
0.0059399604797363 0.0023207664489746
Output for 5.3.14
0.0060079097747803 0.0018219947814941
Output for 5.3.13
0.0068278312683105 0.0017750263214111
Output for 5.3.12
0.0065481662750244 0.0018460750579834
Output for 5.3.11
0.0059089660644531 0.0016911029815674
Output for 5.3.10
0.0065181255340576 0.0017268657684326
Output for 5.3.9
0.0063269138336182 0.0016891956329346
Output for 5.3.8
0.0063221454620361 0.0017058849334717
Output for 5.3.7
0.0060880184173584 0.001716136932373
Output for 5.3.6
0.0057849884033203 0.0017249584197998
Output for 5.3.5
0.0058059692382812 0.0019810199737549
Output for 5.3.4
0.0059530735015869 0.00217604637146
Output for 5.3.3
0.0063381195068359 0.0019149780273438
Output for 5.3.2
0.0061759948730469 0.0016090869903564
Output for 5.3.1
0.0056450366973877 0.0016598701477051
Output for 5.3.0
0.0059990882873535 0.0016989707946777
Output for 5.2.17
0.0099060535430908 0.0017390251159668
Output for 5.2.16
0.0091052055358887 0.0017731189727783
Output for 5.2.15
0.0088558197021484 0.0016899108886719
Output for 5.2.14
0.0089259147644043 0.0017940998077393
Output for 5.2.13
0.009641170501709 0.0016980171203613
Output for 5.2.12
0.0091698169708252 0.0016880035400391
Output for 5.2.11
0.0095829963684082 0.0018739700317383
Output for 5.2.10
0.0090560913085938 0.001755952835083
Output for 5.2.9
0.0098030567169189 0.0017468929290771
Output for 5.2.8
0.0090181827545166 0.0016980171203613
Output for 5.2.7
0.0092740058898926 0.0017280578613281
Output for 5.2.6
0.0090820789337158 0.0016748905181885
Output for 5.2.5
0.010228872299194 0.0016961097717285
Output for 5.2.4
0.0086979866027832 0.0017631053924561
Output for 5.2.3
0.0091180801391602 0.0017540454864502
Output for 5.2.2
0.0093998908996582 0.0017180442810059
Output for 5.2.1
0.012310981750488 0.0021860599517822
Output for 5.2.0
0.0091719627380371 0.0021960735321045
Output for 5.1.6
0.0085170269012451 0.0021181106567383
Output for 5.1.5
0.0091230869293213 0.0020861625671387
Output for 5.1.4
0.01042103767395 0.0036361217498779
Output for 5.1.3
0.0089840888977051 0.0023040771484375
Output for 5.1.2
0.0096859931945801 0.0020639896392822
Output for 5.1.1
0.0092048645019531 0.0020389556884766
Output for 5.1.0
0.0091738700866699 0.0027320384979248
Output for 5.0.5
0.016237020492554 0.0038340091705322
Output for 5.0.4
0.016162872314453 0.0039761066436768
Output for 5.0.3
0.015052080154419 0.004241943359375
Output for 5.0.2
0.015771865844727 0.0041821002960205
Output for 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.015728950500488PHP_EOL0.0039150714874268
Output for 5.0.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.017435073852539PHP_EOL0.0037698745727539
Output for 4.4.9
0.016288 0.003821
Output for 4.4.8
0.017336 0.003849
Output for 4.4.7
0.018188 0.003875
Output for 4.4.6
0.015938 0.003727
Output for 4.4.5
0.024892 0.004425
Output for 4.4.4
0.017292 0.003941
Output for 4.4.3
0.016444 0.003677
Output for 4.4.2
0.017831 0.00401
Output for 4.4.1
0.017061 0.0038699999999999
Output for 4.4.0
0.017571 0.003849
Output for 4.3.11
0.023699 0.0047700000000001
Output for 4.3.10
0.016446 0.004097
Output for 4.3.9
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.017775PHP_EOL-0.996308
Output for 4.3.8
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.020078PHP_EOL0.004112
Output for 4.3.7
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.018398PHP_EOL0.004376
Output for 4.3.6
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.017639PHP_EOL0.00378
Output for 4.3.5
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.017444PHP_EOL0.004154
Output for 4.3.4
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.016498PHP_EOL0.012879
Output for 4.3.3
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.017698PHP_EOL0.00415
Output for 4.3.2
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.023466PHP_EOL0.006159
Output for 4.3.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/mHGk5 on line 15 0.016749PHP_EOL0.003816
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