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 ', '.(100 - $walk / $map * 100).'%';
Output for 7.1.0
array_walk 0.0005640983581543, array_map 0.0005640983581543, 0%
Output for 7.0.14
array_walk 0.0007469654083252, array_map 0.00083589553833008, 10.63890473474%
Output for 7.0.10
array_walk 0.00067996978759766, array_map 0.00083208084106445, 18.280802292264%
Output for 7.0.9
array_walk 0.00039410591125488, array_map 0.00044083595275879, 10.60032449973%
Output for 7.0.8
array_walk 0.00040817260742188, array_map 0.00049114227294922, 16.893203883495%
Output for 7.0.7
array_walk 0.00054788589477539, array_map 0.00066304206848145, 17.367853290183%
Output for 7.0.6
array_walk 0.0010759830474854, array_map 0.00081992149353027, -31.230008723466%
Output for 7.0.5
array_walk 0.00058984756469727, array_map 0.00069093704223633, 14.630779848171%
Output for 7.0.4
array_walk 0.00067710876464844, array_map 0.00077605247497559, 12.749615975422%
Output for 7.0.3
array_walk 0.00087213516235352, array_map 0.0009920597076416, 12.088440278779%
Output for 7.0.2
array_walk 0.00069689750671387, array_map 0.00064778327941895, -7.5818917924181%
Output for 7.0.1
array_walk 0.00083088874816895, array_map 0.00094509124755859, 12.083753784057%
Output for 7.0.0
array_walk 0.00050091743469238, array_map 0.00057101249694824, 12.275574112735%
Output for 5.6.28
array_walk 0.0024030208587646, array_map 0.0037951469421387, 36.681743937681%
Output for 5.6.25
array_walk 0.0020959377288818, array_map 0.0033080577850342, 36.641441441441%
Output for 5.6.24
array_walk 0.0014631748199463, array_map 0.0022120475769043, 33.854278939427%
Output for 5.6.23
array_walk 0.0014200210571289, array_map 0.0021600723266602, 34.260485651214%
Output for 5.6.22
array_walk 0.0014238357543945, array_map 0.0022530555725098, 36.804232804233%
Output for 5.6.21
array_walk 0.002147912979126, array_map 0.0033471584320068, 35.828762732388%
Output for 5.6.20
array_walk 0.0011610984802246, array_map 0.0017578601837158, 33.948189339482%
Output for 5.6.19
array_walk 0.0014169216156006, array_map 0.0021519660949707, 34.156880124086%
Output for 5.6.18
array_walk 0.0011420249938965, array_map 0.0017480850219727, 34.669939989089%
Output for 5.6.17
array_walk 0.00111985206604, array_map 0.0017509460449219, 36.04302832244%
Output for 5.6.16
array_walk 0.0014140605926514, array_map 0.002208948135376, 35.984889368591%
Output for 5.6.15
array_walk 0.0019681453704834, array_map 0.002971887588501, 33.774568792619%
Output for 5.6.14
array_walk 0.0017240047454834, array_map 0.0021600723266602, 20.187637969095%
Output for 5.6.13
array_walk 0.0014219284057617, array_map 0.0021440982818604, 33.681752474147%
Output for 5.6.12
array_walk 0.0019130706787109, array_map 0.0029060840606689, 34.170153417015%
Output for 5.6.11
array_walk 0.001399040222168, array_map 0.0022239685058594, 37.092624356775%
Output for 5.6.10
array_walk 0.0018329620361328, array_map 0.0028209686279297, 35.023664638269%
Output for 5.6.9
array_walk 0.0013298988342285, array_map 0.0021190643310547, 37.241224122412%
Output for 5.6.8
array_walk 0.0023238658905029, array_map 0.0032880306243896, 29.323471829454%
Output for 5.6.7
array_walk 0.0023999214172363, array_map 0.0034911632537842, 31.25725602677%
Output for 5.6.6
array_walk 0.0017809867858887, array_map 0.0027968883514404, 36.322564146279%
Output for 5.6.5
array_walk 0.0022430419921875, array_map 0.0036909580230713, 39.228731994057%
Output for 5.6.4
array_walk 0.0019240379333496, array_map 0.002932071685791, 34.379573914458%
Output for 5.6.3
array_walk 0.0018420219421387, array_map 0.0030391216278076, 39.38966031223%
Output for 5.6.2
array_walk 0.0021669864654541, array_map 0.0032520294189453, 33.365102639296%
Output for 5.6.1
array_walk 0.0022318363189697, array_map 0.0034399032592773, 35.119212642085%
Output for 5.6.0
array_walk 0.0020818710327148, array_map 0.0031640529632568, 34.202396202245%
Output for 5.5.38
array_walk 0.0013058185577393, array_map 0.0020828247070312, 37.305402930403%
Output for 5.5.37
array_walk 0.0012760162353516, array_map 0.0020859241485596, 38.827294547948%
Output for 5.5.36
array_walk 0.0012710094451904, array_map 0.0020339488983154, 37.510256710819%
Output for 5.5.35
array_walk 0.0019068717956543, array_map 0.0030150413513184, 36.754705045074%
Output for 5.5.34
array_walk 0.0010600090026855, array_map 0.0017969608306885, 41.011012339127%
Output for 5.5.33
array_walk 0.0013341903686523, array_map 0.0021390914916992, 37.628176549264%
Output for 5.5.32
array_walk 0.0017750263214111, array_map 0.0030050277709961, 40.931450333228%
Output for 5.5.31
array_walk 0.001331090927124, array_map 0.0021119117736816, 36.972228494017%
Output for 5.5.30
array_walk 0.0019259452819824, array_map 0.0030159950256348, 36.142292490119%
Output for 5.5.29
array_walk 0.0013399124145508, array_map 0.0021569728851318, 37.879960207804%
Output for 5.5.28
array_walk 0.0017669200897217, array_map 0.0027050971984863, 34.681826194253%
Output for 5.5.27
array_walk 0.0013089179992676, array_map 0.002147912979126, 39.060939060939%
Output for 5.5.26
array_walk 0.0016298294067383, array_map 0.0024890899658203, 34.521072796935%
Output for 5.5.25
array_walk 0.0015451908111572, array_map 0.0023770332336426, 34.994984954865%
Output for 5.5.24
array_walk 0.0021820068359375, array_map 0.0034499168395996, 36.75190048376%
Output for 5.5.23
array_walk 0.0030801296234131, array_map 0.0030200481414795, -1.9894213310176%
Output for 5.5.22
array_walk 0.0022430419921875, array_map 0.0036020278930664, 37.728355837967%
Output for 5.5.21
array_walk 0.0018470287322998, array_map 0.0029659271240234, 37.725080385852%
Output for 5.5.20
array_walk 0.0020039081573486, array_map 0.0032567977905273, 38.469985358712%
Output for 5.5.19
array_walk 0.0014688968658447, array_map 0.0023379325866699, 37.171119722619%
Output for 5.5.18
array_walk 0.0021040439605713, array_map 0.0034148693084717, 38.385813027997%
Output for 5.5.16
array_walk 0.0020449161529541, array_map 0.0032460689544678, 37.003305178112%
Output for 5.5.15
array_walk 0.0021319389343262, array_map 0.0033929347991943, 37.165343264704%
Output for 5.5.14
array_walk 0.0016429424285889, array_map 0.0026140213012695, 37.148850784385%
Output for 5.5.13
array_walk 0.0019099712371826, array_map 0.0028080940246582, 31.983358804551%
Output for 5.5.12
array_walk 0.0022079944610596, array_map 0.0035669803619385, 38.099057549629%
Output for 5.5.11
array_walk 0.002187967300415, array_map 0.0034358501434326, 36.319478176393%
Output for 5.5.10
array_walk 0.0020771026611328, array_map 0.0029611587524414, 29.855072463768%
Output for 5.5.9
array_walk 0.0019810199737549, array_map 0.003126859664917, 36.645062905071%
Output for 5.5.8
array_walk 0.0021359920501709, array_map 0.0034298896789551, 37.724176282497%
Output for 5.5.7
array_walk 0.0018730163574219, array_map 0.0030739307403564, 39.067711161095%
Output for 5.5.6
array_walk 0.0019371509552002, array_map 0.0031120777130127, 37.753773078986%
Output for 5.5.5
array_walk 0.0021660327911377, array_map 0.0034670829772949, 37.525787374501%
Output for 5.5.4
array_walk 0.0026381015777588, array_map 0.0030450820922852, 13.365173817726%
Output for 5.5.3
array_walk 0.0017950534820557, array_map 0.0028049945831299, 36.005099872503%
Output for 5.5.2
array_walk 0.0018420219421387, array_map 0.0028769969940186, 35.974144360653%
Output for 5.5.1
array_walk 0.0022649765014648, array_map 0.003436803817749, 34.09642733264%
Output for 5.5.0
array_walk 0.0021920204162598, array_map 0.0034570693969727, 36.593103448276%
Output for 5.4.45
array_walk 0.0013539791107178, array_map 0.0020651817321777, 34.4377741861%
Output for 5.4.44
array_walk 0.0013320446014404, array_map 0.0022361278533936, 40.43074954686%
Output for 5.4.43
array_walk 0.0014870166778564, array_map 0.0022189617156982, 32.985924572902%
Output for 5.4.42
array_walk 0.0022070407867432, array_map 0.0032429695129395, 31.943831789443%
Output for 5.4.41
array_walk 0.0016400814056396, array_map 0.0025210380554199, 34.94420276149%
Output for 5.4.40
array_walk 0.0019159317016602, array_map 0.002856969833374, 32.938329299841%
Output for 5.4.39
array_walk 0.0023260116577148, array_map 0.0036208629608154, 35.760848093764%
Output for 5.4.38
array_walk 0.0022149085998535, array_map 0.0035090446472168, 36.880010871042%
Output for 5.4.37
array_walk 0.0022721290588379, array_map 0.00345778465271, 34.289457353651%
Output for 5.4.36
array_walk 0.0021400451660156, array_map 0.0034329891204834, 37.662337662338%
Output for 5.4.35
array_walk 0.0021090507507324, array_map 0.0033700466156006, 37.417757339936%
Output for 5.4.34
array_walk 0.0013549327850342, array_map 0.0021231174468994, 36.181920269512%
Output for 5.4.32
array_walk 0.0018811225891113, array_map 0.0026159286499023, 28.089682829019%
Output for 5.4.31
array_walk 0.0021698474884033, array_map 0.0034639835357666, 37.359763232156%
Output for 5.4.30
array_walk 0.001784086227417, array_map 0.0027599334716797, 35.357636489288%
Output for 5.4.29
array_walk 0.0022609233856201, array_map 0.0037209987640381, 39.238803101173%
Output for 5.4.28
array_walk 0.0021910667419434, array_map 0.0034539699554443, 36.563815834886%
Output for 5.4.27
array_walk 0.0020840167999268, array_map 0.0032341480255127, 35.562108367121%
Output for 5.4.26
array_walk 0.0019900798797607, array_map 0.0029761791229248, 33.13306096291%
Output for 5.4.25
array_walk 0.0021088123321533, array_map 0.0032761096954346, 35.630594570992%
Output for 5.4.24
array_walk 0.0019760131835938, array_map 0.0031719207763672, 37.702946482261%
Output for 5.4.23
array_walk 0.0023329257965088, array_map 0.003648042678833, 36.049931377034%
Output for 5.4.22
array_walk 0.0018360614776611, array_map 0.0032110214233398, 42.820017820018%
Output for 5.4.21
array_walk 0.0020430088043213, array_map 0.0032470226287842, 37.08054923269%
Output for 5.4.20
array_walk 0.0023229122161865, array_map 0.0036180019378662, 35.795716639209%
Output for 5.4.19
array_walk 0.0017950534820557, array_map 0.0031161308288574, 42.394797245601%
Output for 5.4.18
array_walk 0.00211501121521, array_map 0.0033118724822998, 36.138506946944%
Output for 5.4.17
array_walk 0.0023579597473145, array_map 0.0033009052276611, 28.56626941134%
Output for 5.4.16
array_walk 0.0020020008087158, array_map 0.0024170875549316, 17.173012428487%
Output for 5.4.15
array_walk 0.0018050670623779, array_map 0.0031039714813232, 41.846531991704%
Output for 5.4.14
array_walk 0.0016441345214844, array_map 0.0026059150695801, 36.907593778591%
Output for 5.4.13
array_walk 0.0019168853759766, array_map 0.003046989440918, 37.089201877934%
Output for 5.4.12
array_walk 0.0020530223846436, array_map 0.0039331912994385, 47.802630781354%
Output for 5.4.11
array_walk 0.0021829605102539, array_map 0.0033090114593506, 34.029829238418%
Output for 5.4.10
array_walk 0.0019221305847168, array_map 0.003046989440918, 36.917057902973%
Output for 5.4.9
array_walk 0.0020890235900879, array_map 0.0032498836517334, 35.720049886289%
Output for 5.4.8
array_walk 0.0022928714752197, array_map 0.0039050579071045, 41.284571707674%
Output for 5.4.7
array_walk 0.0023658275604248, array_map 0.0037059783935547, 36.161863098302%
Output for 5.4.6
array_walk 0.0019450187683105, array_map 0.0030760765075684, 36.769493101845%
Output for 5.4.5
array_walk 0.0020129680633545, array_map 0.0032811164855957, 38.649905536986%
Output for 5.4.4
array_walk 0.0019738674163818, array_map 0.0031449794769287, 37.237510423774%
Output for 5.4.3
array_walk 0.0021579265594482, array_map 0.0034689903259277, 37.79381443299%
Output for 5.4.2
array_walk 0.0023090839385986, array_map 0.003715991973877, 37.860900808418%
Output for 5.4.1
array_walk 0.0020418167114258, array_map 0.0032918453216553, 37.973491707105%
Output for 5.4.0
array_walk 0.0023989677429199, array_map 0.0036640167236328, 34.526288391463%
Output for 5.3.29
array_walk 0.0014138221740723, array_map 0.0021979808807373, 35.676320642152%
Output for 5.3.28
array_walk 0.0022108554840088, array_map 0.0032949447631836, 32.901591895803%
Output for 5.3.27
array_walk 0.0022799968719482, array_map 0.0035288333892822, 35.389500709412%
Output for 5.3.26
array_walk 0.0022599697113037, array_map 0.00335693359375, 32.677556818182%
Output for 5.3.25
array_walk 0.0023200511932373, array_map 0.0035209655761719, 34.10752979415%
Output for 5.3.24
array_walk 0.0023829936981201, array_map 0.0036540031433105, 34.784027143416%
Output for 5.3.23
array_walk 0.002208948135376, array_map 0.0033161640167236, 33.388453519304%
Output for 5.3.22
array_walk 0.0025708675384521, array_map 0.0038590431213379, 33.380699369826%
Output for 5.3.21
array_walk 0.0020949840545654, array_map 0.0032219886779785, 34.978540772532%
Output for 5.3.20
array_walk 0.0023999214172363, array_map 0.0035989284515381, 33.31566743955%
Output for 5.3.19
array_walk 0.0024440288543701, array_map 0.0038101673126221, 35.855077905012%
Output for 5.3.18
array_walk 0.002039909362793, array_map 0.0031039714813232, 34.280666717874%
Output for 5.3.17
array_walk 0.0025529861450195, array_map 0.0036008358001709, 29.100178772429%
Output for 5.3.16
array_walk 0.0023269653320312, array_map 0.0034780502319336, 33.095695091856%
Output for 5.3.15
array_walk 0.0025179386138916, array_map 0.0036220550537109, 30.483149025803%
Output for 5.3.14
array_walk 0.002079963684082, array_map 0.0043578147888184, 52.270489112594%
Output for 5.3.13
array_walk 0.002532958984375, array_map 0.0037178993225098, 31.87123252533%
Output for 5.3.12
array_walk 0.0023717880249023, array_map 0.0030479431152344, 22.183979974969%
Output for 5.3.11
array_walk 0.0020899772644043, array_map 0.0030629634857178, 31.766171090527%
Output for 5.3.10
array_walk 0.0021770000457764, array_map 0.0034928321838379, 37.672354948805%
Output for 5.3.9
array_walk 0.0026090145111084, array_map 0.0038840770721436, 32.82794180836%
Output for 5.3.8
array_walk 0.0020241737365723, array_map 0.0030200481414795, 32.975448014526%
Output for 5.3.7
array_walk 0.0020380020141602, array_map 0.0030968189239502, 34.190468858265%
Output for 5.3.6
array_walk 0.0022480487823486, array_map 0.0028870105743408, 22.132298290528%
Output for 5.3.5
array_walk 0.0024559497833252, array_map 0.003662109375, 32.936197916667%
Output for 5.3.4
array_walk 0.0024471282958984, array_map 0.0041079521179199, 40.429483459083%
Output for 5.3.3
array_walk 0.0024840831756592, array_map 0.0037841796875, 34.356098790323%
Output for 5.3.2
array_walk 0.0019800662994385, array_map 0.0030560493469238, 35.208300826962%
Output for 5.3.1
array_walk 0.0025360584259033, array_map 0.0038800239562988, 34.638072999877%
Output for 5.3.0
array_walk 0.0019900798797607, array_map 0.0029990673065186, 33.643373877097%
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/SQnDe 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/SQnDe on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/SQnDe on line 5
Process exited with code 255.