3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $iter = 100; $array = range(0, $iter); $function = function($val, $key) {}; $t = microtime(true); for($i = 0; $i < $iter; $i++) { array_walk($array, $function); } echo 'array_walk '.($walk = microtime(true) - $t); $t = microtime(true); for($i = 0; $i < $iter; $i++) { array_map($function, $array, array_keys($array)); } echo ', array_map '.($map = microtime(true) - $t); echo $walk / $map * 100;
Output for 7.1.0
array_walk 0.00069689750671387, array_map 0.00067400932312012103.39582596392
Output for 7.0.14
array_walk 0.00079107284545898, array_map 0.0008771419525146590.187550964936
Output for 7.0.8
array_walk 0.00051498413085938, array_map 0.0005688667297363390.528080469405
Output for 7.0.7
array_walk 0.00041389465332031, array_map 0.0004920959472656284.108527131783
Output for 7.0.6
array_walk 0.00060296058654785, array_map 0.0006878376007080187.660311958406
Output for 7.0.5
array_walk 0.0008540153503418, array_map 0.000961065292358488.861324733317
Output for 7.0.4
array_walk 0.0010099411010742, array_map 0.001060009002685595.27665317139
Output for 7.0.3
array_walk 0.00098919868469238, array_map 0.001165866851806684.846625766871
Output for 7.0.2
array_walk 0.00091195106506348, array_map 0.001005887985229590.661294145532
Output for 7.0.1
array_walk 0.00079011917114258, array_map 0.0009109973907470786.731222193143
Output for 7.0.0
array_walk 0.00064396858215332, array_map 0.0007197856903076289.466710831401
Output for hhvm-3.12.0
array_walk 0.001101016998291, array_map 0.001714944839477564.201306826081
Output for hhvm-3.10.0
array_walk 0.0012178421020508, array_map 0.001798868179321367.700463883366
Output for 5.6.23
array_walk 0.0023899078369141, array_map 0.003852128982543962.041220523612
Output for 5.6.22
array_walk 0.0017199516296387, array_map 0.002665996551513764.514398139868
Output for 5.6.21
array_walk 0.0023579597473145, array_map 0.003560066223144566.233592285025
Output for 5.6.20
array_walk 0.0022718906402588, array_map 0.003476142883300865.356652949246
Output for 5.6.19
array_walk 0.0024130344390869, array_map 0.00385689735412662.564134264697
Output for 5.6.18
array_walk 0.0015850067138672, array_map 0.002239942550659270.761043108036
Output for 5.6.17
array_walk 0.0018680095672607, array_map 0.003118991851806659.891453906131
Output for 5.6.16
array_walk 0.0015830993652344, array_map 0.002445936203002964.723657276538
Output for 5.6.15
array_walk 0.00235915184021, array_map 0.003456830978393668.246085936961
Output for 5.6.14
array_walk 0.0020871162414551, array_map 0.003051996231079168.385282399813
Output for 5.6.13
array_walk 0.002065896987915, array_map 0.003134965896606465.898547418055
Output for 5.6.12
array_walk 0.0014050006866455, array_map 0.002113103866577166.489901839106
Output for 5.6.11
array_walk 0.0021040439605713, array_map 0.003353118896484462.748862343572
Output for 5.6.10
array_walk 0.0024199485778809, array_map 0.003781080245971764.001513336276
Output for 5.6.9
array_walk 0.0016942024230957, array_map 0.002719879150390662.289621318373
Output for 5.6.8
array_walk 0.0017800331115723, array_map 0.002588033676147568.779364348227
Output for 5.6.7
array_walk 0.0019590854644775, array_map 0.003036022186279364.528035181404
Output for 5.6.6
array_walk 0.0021848678588867, array_map 0.003561019897460961.355115158008
Output for 5.6.5
array_walk 0.0018050670623779, array_map 0.00280284881591864.401156856073
Output for 5.6.4
array_walk 0.0020220279693604, array_map 0.002709865570068474.617279605842
Output for 5.6.3
array_walk 0.0018570423126221, array_map 0.00288510322570864.366581274275
Output for 5.6.2
array_walk 0.0022060871124268, array_map 0.003476142883300863.463648834019
Output for 5.6.1
array_walk 0.0022079944610596, array_map 0.003418207168579164.595103578154
Output for 5.6.0
array_walk 0.0017938613891602, array_map 0.002823114395141663.541930580187
Output for 5.5.37
array_walk 0.0016398429870605, array_map 0.002557992935180764.106626899059
Output for 5.5.36
array_walk 0.0023090839385986, array_map 0.003673076629638762.865117486693
Output for 5.5.35
array_walk 0.0017108917236328, array_map 0.002664089202880964.220511902631
Output for 5.5.34
array_walk 0.0022311210632324, array_map 0.003633022308349661.412258826618
Output for 5.5.33
array_walk 0.0023472309112549, array_map 0.003720998764038163.080668930608
Output for 5.5.32
array_walk 0.0016210079193115, array_map 0.002536058425903363.918398044561
Output for 5.5.31
array_walk 0.0018520355224609, array_map 0.002928018569946363.252178161388
Output for 5.5.30
array_walk 0.0022859573364258, array_map 0.003969907760620157.582127199568
Output for 5.5.29
array_walk 0.0017631053924561, array_map 0.002793073654174863.124199743918
Output for 5.5.28
array_walk 0.0021169185638428, array_map 0.003248214721679765.171755725191
Output for 5.5.27
array_walk 0.0017209053039551, array_map 0.002771854400634862.084981937038
Output for 5.5.26
array_walk 0.002202033996582, array_map 0.003581047058105561.491344873502
Output for 5.5.25
array_walk 0.0019371509552002, array_map 0.003021001815795964.122800094704
Output for 5.5.24
array_walk 0.0022799968719482, array_map 0.003886938095092858.657915721033
Output for 5.5.23
array_walk 0.0021500587463379, array_map 0.003438949584960962.520798668885
Output for 5.5.22
array_walk 0.0019450187683105, array_map 0.003153800964355561.672210462655
Output for 5.5.21
array_walk 0.0024378299713135, array_map 0.003482103347778370.010270455324
Output for 5.5.20
array_walk 0.0021281242370605, array_map 0.003339052200317463.734380578365
Output for 5.5.19
array_walk 0.0013248920440674, array_map 0.002123832702636762.382128423889
Output for 5.5.18
array_walk 0.0020310878753662, array_map 0.003226995468139662.94052456594
Output for 5.5.16
array_walk 0.0020761489868164, array_map 0.003577947616577158.026254414607
Output for 5.5.15
array_walk 0.0023338794708252, array_map 0.003827810287475660.971659919028
Output for 5.5.14
array_walk 0.0019810199737549, array_map 0.00307989120483464.321102337823
Output for 5.5.13
array_walk 0.0018258094787598, array_map 0.00304007530212460.058034663948
Output for 5.5.12
array_walk 0.0020289421081543, array_map 0.00315499305725164.308924658052
Output for 5.5.11
array_walk 0.001823902130127, array_map 0.002832889556884864.383100488133
Output for 5.5.10
array_walk 0.0019350051879883, array_map 0.002756118774414170.207612456747
Output for 5.5.9
array_walk 0.0024070739746094, array_map 0.0020790100097656115.77981651376
Output for 5.5.8
array_walk 0.0021450519561768, array_map 0.003422021865844762.683759492789
Output for 5.5.7
array_walk 0.0018749237060547, array_map 0.003003120422363362.432518259765
Output for 5.5.6
array_walk 0.0021121501922607, array_map 0.003320932388305763.60111996554
Output for 5.5.5
array_walk 0.0022919178009033, array_map 0.003629922866821363.139573070608
Output for 5.5.4
array_walk 0.0017209053039551, array_map 0.002731084823608463.011785246617
Output for 5.5.3
array_walk 0.0021669864654541, array_map 0.003681898117065458.855144725766
Output for 5.5.2
array_walk 0.0020699501037598, array_map 0.003157138824462965.564114182148
Output for 5.5.1
array_walk 0.0021350383758545, array_map 0.003663063049316458.285602707628
Output for 5.5.0
array_walk 0.0021162033081055, array_map 0.003288030624389664.360815024291
Output for 5.4.45
array_walk 0.0022518634796143, array_map 0.003442049026489365.422179123087
Output for 5.4.44
array_walk 0.0019609928131104, array_map 0.003132104873657262.609423764939
Output for 5.4.43
array_walk 0.0014548301696777, array_map 0.002109050750732468.980330092697
Output for 5.4.42
array_walk 0.002100944519043, array_map 0.0032560825347964.523687486271
Output for 5.4.41
array_walk 0.0026450157165527, array_map 0.003730058670043970.910834132311
Output for 5.4.40
array_walk 0.0020351409912109, array_map 0.003324985504150461.207514699555
Output for 5.4.39
array_walk 0.001737117767334, array_map 0.002746820449829163.241038104331
Output for 5.4.38
array_walk 0.0021140575408936, array_map 0.003347873687744163.146275459336
Output for 5.4.37
array_walk 0.002277135848999, array_map 0.00298595428466876.26157777068
Output for 5.4.36
array_walk 0.0022618770599365, array_map 0.004482030868530350.465450289909
Output for 5.4.35
array_walk 0.0020570755004883, array_map 0.003349065780639661.422367765359
Output for 5.4.34
array_walk 0.0023918151855469, array_map 0.003627061843872165.943600867679
Output for 5.4.32
array_walk 0.0013940334320068, array_map 0.002186059951782263.769222379758
Output for 5.4.31
array_walk 0.0013167858123779, array_map 0.002046823501586964.333139196273
Output for 5.4.30
array_walk 0.0021681785583496, array_map 0.003312110900878965.462136481428
Output for 5.4.29
array_walk 0.0015039443969727, array_map 0.002236127853393667.256637168142
Output for 5.4.28
array_walk 0.0021851062774658, array_map 0.003473997116088962.898908791435
Output for 5.4.27
array_walk 0.0018250942230225, array_map 0.002824783325195364.61006076975
Output for 5.4.26
array_walk 0.0022709369659424, array_map 0.003514051437377964.624465703236
Output for 5.4.25
array_walk 0.002371072769165, array_map 0.003854990005493261.506586678211
Output for 5.4.24
array_walk 0.0020840167999268, array_map 0.003367185592651461.891949302556
Output for 5.4.23
array_walk 0.0022060871124268, array_map 0.003744125366210958.92129393785
Output for 5.4.22
array_walk 0.0017459392547607, array_map 0.002737998962402363.76698014629
Output for 5.4.21
array_walk 0.0036730766296387, array_map 0.005645036697387765.06736495333
Output for 5.4.20
array_walk 0.0022060871124268, array_map 0.003714799880981459.386432193056
Output for 5.4.19
array_walk 0.0024440288543701, array_map 0.00401186943054260.919950080228
Output for 5.4.18
array_walk 0.0026521682739258, array_map 0.003845930099487368.960386832806
Output for 5.4.17
array_walk 0.0023272037506104, array_map 0.003748178482055762.088925640863
Output for 5.4.16
array_walk 0.0022001266479492, array_map 0.003423929214477564.257363693336
Output for 5.4.15
array_walk 0.0018501281738281, array_map 0.002958059310913162.545337309583
Output for 5.4.14
array_walk 0.0018670558929443, array_map 0.0029509067535463.270582532116
Output for 5.4.13
array_walk 0.001370906829834, array_map 0.00216197967529363.409792677547
Output for 5.4.12
array_walk 0.0019690990447998, array_map 0.002963066101074266.454779530093
Output for 5.4.11
array_walk 0.002255916595459, array_map 0.003386020660400466.624419095902
Output for 5.4.10
array_walk 0.0020089149475098, array_map 0.003051996231079165.822982579486
Output for 5.4.9
array_walk 0.002208948135376, array_map 0.003701210021972759.681783045607
Output for 5.4.8
array_walk 0.0019619464874268, array_map 0.003129959106445362.68281535649
Output for 5.4.7
array_walk 0.0023369789123535, array_map 0.003671169281005963.657617872451
Output for 5.4.6
array_walk 0.0021400451660156, array_map 0.002857923507690474.881121214649
Output for 5.4.5
array_walk 0.0021579265594482, array_map 0.003365039825439564.127816352558
Output for 5.4.4
array_walk 0.0017309188842773, array_map 0.002772808074951262.424763542562
Output for 5.4.3
array_walk 0.0016870498657227, array_map 0.002653837203979563.570209325308
Output for 5.4.2
array_walk 0.001629114151001, array_map 0.002504110336303765.057602589736
Output for 5.4.1
array_walk 0.0021109580993652, array_map 0.003289937973022564.164069860135
Output for 5.4.0
array_walk 0.0023829936981201, array_map 0.003705978393554764.301338136902
Output for 5.3.29
array_walk 0.0022680759429932, array_map 0.003520011901855564.433757789217
Output for 5.3.28
array_walk 0.0024490356445312, array_map 0.004009008407592861.088314005352
Output for 5.3.27
array_walk 0.0026659965515137, array_map 0.003032207489013787.922629344237
Output for 5.3.26
array_walk 0.0024559497833252, array_map 0.003685951232910266.630012936611
Output for 5.3.25
array_walk 0.0021491050720215, array_map 0.003307104110717864.984500036046
Output for 5.3.24
array_walk 0.0022399425506592, array_map 0.003495216369628964.085948158254
Output for 5.3.23
array_walk 0.0016539096832275, array_map 0.002480030059814566.689098250336
Output for 5.3.22
array_walk 0.0022199153900146, array_map 0.003333091735839866.602288984263
Output for 5.3.21
array_walk 0.0021200180053711, array_map 0.003191947937011766.417687481327
Output for 5.3.20
array_walk 0.0022668838500977, array_map 0.003160953521728571.715190828179
Output for 5.3.19
array_walk 0.001784086227417, array_map 0.002763986587524464.547571810575
Output for 5.3.18
array_walk 0.0020730495452881, array_map 0.002491950988769583.189820130119
Output for 5.3.17
array_walk 0.0016570091247559, array_map 0.002419948577880968.472906403941
Output for 5.3.16
array_walk 0.0024480819702148, array_map 0.003639936447143667.256173445995
Output for 5.3.15
array_walk 0.0025210380554199, array_map 0.003641843795776469.224222585925
Output for 5.3.14
array_walk 0.0022308826446533, array_map 0.003432989120483464.983679422182
Output for 5.3.13
array_walk 0.0015490055084229, array_map 0.002260923385620168.51207423811
Output for 5.3.12
array_walk 0.0017328262329102, array_map 0.002595186233520566.770785484612
Output for 5.3.11
array_walk 0.0025908946990967, array_map 0.003842115402221767.434067638846
Output for 5.3.10
array_walk 0.0024271011352539, array_map 0.003793001174926863.98893707964
Output for 5.3.9
array_walk 0.0025670528411865, array_map 0.003685951232910269.644243208279
Output for 5.3.8
array_walk 0.0024478435516357, array_map 0.003515005111694369.639829071424
Output for 5.3.7
array_walk 0.0019021034240723, array_map 0.002974987030029363.93652828979
Output for 5.3.6
array_walk 0.0016360282897949, array_map 0.00250005722045965.439633797444
Output for 5.3.5
array_walk 0.0024840831756592, array_map 0.003851890563964864.489972765536
Output for 5.3.4
array_walk 0.0019290447235107, array_map 0.003219127655029359.924455636202
Output for 5.3.3
array_walk 0.0023660659790039, array_map 0.003632068634033265.143757384797
Output for 5.3.2
array_walk 0.0018770694732666, array_map 0.002882003784179765.130708140304
Output for 5.3.1
array_walk 0.0019981861114502, array_map 0.003118991851806664.065127656322
Output for 5.3.0
array_walk 0.0018250942230225, array_map 0.002763986587524466.03122573967
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/di3Kb on line 5
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/di3Kb on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/di3Kb on line 5
Process exited with code 255.