3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $iter = 1000; $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.071928977966309, array_map 0.060576915740967, -18.73991451444%
Output for 7.0.14
array_walk 0.065867900848389, array_map 0.06057596206665, -8.7360375323725%
Output for 7.0.10
array_walk 0.057697057723999, array_map 0.054963111877441, -4.9741467561987%
Output for 7.0.9
array_walk 0.038688898086548, array_map 0.045018911361694, 14.060787086319%
Output for 7.0.8
array_walk 0.055011034011841, array_map 0.054099082946777, -1.6857052197366%
Output for 7.0.7
array_walk 0.050244092941284, array_map 0.050539016723633, 0.58355662905235%
Output for 7.0.6
array_walk 0.068787097930908, array_map 0.070125102996826, 1.9080258120669%
Output for 7.0.5
array_walk 0.067853212356567, array_map 0.070000886917114, 3.0680676418998%
Output for 7.0.4
array_walk 0.071295976638794, array_map 0.069322109222412, -2.8473851106418%
Output for 7.0.3
array_walk 0.068573951721191, array_map 0.070220947265625, 2.3454476314646%
Output for 7.0.2
array_walk 0.083234071731567, array_map 0.070679903030396, -17.762006119014%
Output for 7.0.1
array_walk 0.074783802032471, array_map 0.07227611541748, -3.4695924103078%
Output for 7.0.0
array_walk 0.078963994979858, array_map 0.073020935058594, -8.1388439034584%
Output for hhvm-3.12.0
array_walk 0.24309277534485, array_map 0.25034213066101, 2.8957791870752%
Output for hhvm-3.10.0
array_walk 0.22859406471252, array_map 0.27064085006714, 15.536008457032%
Output for 5.6.28
array_walk 0.18508815765381, array_map 0.31787705421448, 41.773665258353%
Output for 5.6.25
array_walk 0.14932012557983, array_map 0.3166971206665, 52.85081049503%
Output for 5.6.24
array_walk 0.14102506637573, array_map 0.3166720867157, 55.466530745306%
Output for 5.6.23
array_walk 0.21321201324463, array_map 0.31582593917847, 32.490658050684%
Output for 5.6.22
array_walk 0.15467381477356, array_map 0.30335712432861, 49.012631526%
Output for 5.6.21
array_walk 0.13741898536682, array_map 0.31806802749634, 56.795724974777%
Output for 5.6.20
array_walk 0.14228081703186, array_map 0.31614398956299, 54.994932141984%
Output for 5.6.19
array_walk 0.14125680923462, array_map 0.32138085365295, 56.046912058067%
Output for 5.6.18
array_walk 0.14860892295837, array_map 0.31867599487305, 53.366765821951%
Output for 5.6.17
array_walk 0.13811898231506, array_map 0.31830286979675, 56.607685503038%
Output for 5.6.16
array_walk 0.1452898979187, array_map 0.31908798217773, 54.467135701221%
Output for 5.6.15
array_walk 0.14650511741638, array_map 0.31668305397034, 53.737620128514%
Output for 5.6.14
array_walk 0.14542508125305, array_map 0.33934116363525, 57.144874587227%
Output for 5.6.13
array_walk 0.14121603965759, array_map 0.31829285621643, 55.633299051623%
Output for 5.6.12
array_walk 0.15403318405151, array_map 0.30657911300659, 49.757443505878%
Output for 5.6.11
array_walk 0.1457998752594, array_map 0.29814314842224, 51.097358422971%
Output for 5.6.10
array_walk 0.15407299995422, array_map 0.29908299446106, 48.484867810067%
Output for 5.6.9
array_walk 0.13719916343689, array_map 0.30286598205566, 54.699711566922%
Output for 5.6.8
array_walk 0.14458084106445, array_map 0.32222604751587, 55.130616479001%
Output for 5.6.7
array_walk 0.14788603782654, array_map 0.30454111099243, 51.439712902928%
Output for 5.6.6
array_walk 0.13322901725769, array_map 0.31063103675842, 57.110204232006%
Output for 5.6.5
array_walk 0.13177299499512, array_map 0.27911901473999, 52.789674641884%
Output for 5.6.4
array_walk 0.15633296966553, array_map 0.33822798728943, 53.778819157343%
Output for 5.6.3
array_walk 0.13280701637268, array_map 0.26957321166992, 50.73434205499%
Output for 5.6.2
array_walk 0.14227390289307, array_map 0.29372906684875, 51.562879214019%
Output for 5.6.1
array_walk 0.15278506278992, array_map 0.29710698127747, 48.575741258926%
Output for 5.6.0
array_walk 0.14925789833069, array_map 0.31941080093384, 53.270866891691%
Output for 5.5.38
array_walk 0.14573001861572, array_map 0.31283783912659, 53.416754500483%
Output for 5.5.37
array_walk 0.19490504264832, array_map 0.37366700172424, 47.839910468693%
Output for 5.5.36
array_walk 0.12773489952087, array_map 0.28889584541321, 55.785137948877%
Output for 5.5.35
array_walk 0.14284920692444, array_map 0.30889010429382, 53.754035840346%
Output for 5.5.34
array_walk 0.14497208595276, array_map 0.30985617637634, 53.213104335%
Output for 5.5.33
array_walk 0.14184784889221, array_map 0.31090593338013, 54.375959522528%
Output for 5.5.32
array_walk 0.16145992279053, array_map 0.31678915023804, 49.032369742081%
Output for 5.5.31
array_walk 0.15566205978394, array_map 0.30833888053894, 49.515915893624%
Output for 5.5.30
array_walk 0.13453602790833, array_map 0.30748510360718, 56.246326625241%
Output for 5.5.29
array_walk 0.14145994186401, array_map 0.30773711204529, 54.032212454377%
Output for 5.5.28
array_walk 0.13383197784424, array_map 0.3096330165863, 56.777226369548%
Output for 5.5.27
array_walk 0.15969896316528, array_map 0.29056215286255, 45.037933677195%
Output for 5.5.26
array_walk 0.14729189872742, array_map 0.29122996330261, 49.424194867487%
Output for 5.5.25
array_walk 0.13537383079529, array_map 0.29050016403198, 53.399740324971%
Output for 5.5.24
array_walk 0.14424920082092, array_map 0.30565309524536, 52.806235871707%
Output for 5.5.23
array_walk 0.14011383056641, array_map 0.3032009601593, 53.788460797489%
Output for 5.5.22
array_walk 0.13229203224182, array_map 0.28527212142944, 53.626021505736%
Output for 5.5.21
array_walk 0.13308906555176, array_map 0.28959393501282, 54.04286849244%
Output for 5.5.20
array_walk 0.12559103965759, array_map 0.2866370677948, 56.184648195082%
Output for 5.5.19
array_walk 0.15099692344666, array_map 0.32564496994019, 53.631427663572%
Output for 5.5.18
array_walk 0.12867403030396, array_map 0.29053401947021, 55.711200175941%
Output for 5.5.16
array_walk 0.14899301528931, array_map 0.31013584136963, 51.958788564611%
Output for 5.5.15
array_walk 0.16209983825684, array_map 0.30466413497925, 46.793921684324%
Output for 5.5.14
array_walk 0.1415228843689, array_map 0.31304693222046, 54.791799630469%
Output for 5.5.13
array_walk 0.13279891014099, array_map 0.30626606941223, 56.6393657659%
Output for 5.5.12
array_walk 0.13890695571899, array_map 0.31236219406128, 55.530163905897%
Output for 5.5.11
array_walk 0.15726900100708, array_map 0.29438710212708, 46.577482549085%
Output for 5.5.10
array_walk 0.15242195129395, array_map 0.28987193107605, 47.417485118986%
Output for 5.5.9
array_walk 0.14146184921265, array_map 0.29068207740784, 51.334512786569%
Output for 5.5.8
array_walk 0.12971901893616, array_map 0.28914308547974, 55.136738365736%
Output for 5.5.7
array_walk 0.16076803207397, array_map 0.2890260219574, 44.375931625398%
Output for 5.5.6
array_walk 0.14291620254517, array_map 0.30851316452026, 53.675817118728%
Output for 5.5.5
array_walk 0.16232800483704, array_map 0.30825090408325, 47.339001220514%
Output for 5.5.4
array_walk 0.12793493270874, array_map 0.2756679058075, 53.590922260613%
Output for 5.5.3
array_walk 0.136883020401, array_map 0.30684685707092, 55.390444045069%
Output for 5.5.2
array_walk 0.15077614784241, array_map 0.31270408630371, 51.783121984544%
Output for 5.5.1
array_walk 0.13055992126465, array_map 0.30716490745544, 57.495170152669%
Output for 5.5.0
array_walk 0.14295601844788, array_map 0.37835311889648, 62.216244215238%
Output for 5.4.45
array_walk 0.16203713417053, array_map 0.31028318405151, 47.777661665471%
Output for 5.4.44
array_walk 0.14044308662415, array_map 0.30725884437561, 54.291604881368%
Output for 5.4.43
array_walk 0.17315196990967, array_map 0.38461685180664, 54.980659558641%
Output for 5.4.42
array_walk 0.14438104629517, array_map 0.32156801223755, 55.100930191866%
Output for 5.4.41
array_walk 0.14710903167725, array_map 0.29471015930176, 50.083488120741%
Output for 5.4.40
array_walk 0.17990589141846, array_map 0.34083485603333, 47.216111194664%
Output for 5.4.39
array_walk 0.14164090156555, array_map 0.29078507423401, 51.290174731745%
Output for 5.4.38
array_walk 0.14860987663269, array_map 0.33932614326477, 56.204412898203%
Output for 5.4.37
array_walk 0.16024208068848, array_map 0.25438404083252, 37.007809073221%
Output for 5.4.36
array_walk 0.13122797012329, array_map 0.31352496147156, 58.144330994457%
Output for 5.4.35
array_walk 0.13401198387146, array_map 0.29602408409119, 54.729364577586%
Output for 5.4.34
array_walk 0.16313600540161, array_map 0.2944540977478, 44.59713529226%
Output for 5.4.32
array_walk 0.14844989776611, array_map 0.30526781082153, 51.370602302743%
Output for 5.4.31
array_walk 0.16195392608643, array_map 0.30701613426208, 47.249050452777%
Output for 5.4.30
array_walk 0.14849781990051, array_map 0.3112051486969, 52.282981010336%
Output for 5.4.29
array_walk 0.15700197219849, array_map 0.30837512016296, 49.087341379708%
Output for 5.4.28
array_walk 0.15555906295776, array_map 0.30875086784363, 49.616639446484%
Output for 5.4.27
array_walk 0.14796996116638, array_map 0.27305698394775, 45.809860261734%
Output for 5.4.26
array_walk 0.17495608329773, array_map 0.32342600822449, 45.905375928737%
Output for 5.4.25
array_walk 0.15527296066284, array_map 0.28985905647278, 46.431564860412%
Output for 5.4.24
array_walk 0.14041996002197, array_map 0.29403305053711, 52.243477471166%
Output for 5.4.23
array_walk 0.15062880516052, array_map 0.31365203857422, 51.975824596823%
Output for 5.4.22
array_walk 0.16312193870544, array_map 0.30591201782227, 46.676845235868%
Output for 5.4.21
array_walk 0.13791990280151, array_map 0.3101978302002, 55.538082676947%
Output for 5.4.20
array_walk 0.14556407928467, array_map 0.3107750415802, 53.160949301296%
Output for 5.4.19
array_walk 0.15757703781128, array_map 0.25655317306519, 38.579189674944%
Output for 5.4.18
array_walk 0.14632987976074, array_map 0.30955910682678, 52.72958329001%
Output for 5.4.17
array_walk 0.1429169178009, array_map 0.30894708633423, 53.740648763947%
Output for 5.4.16
array_walk 0.13713812828064, array_map 0.30630993843079, 55.228965477518%
Output for 5.4.15
array_walk 0.14491105079651, array_map 0.31494998931885, 53.989186946819%
Output for 5.4.14
array_walk 0.13913798332214, array_map 0.30977916717529, 55.084783592497%
Output for 5.4.13
array_walk 0.15687108039856, array_map 0.29498505592346, 46.820668624223%
Output for 5.4.12
array_walk 0.16709899902344, array_map 0.29296588897705, 42.962984664564%
Output for 5.4.11
array_walk 0.17390489578247, array_map 0.29221701622009, 40.487758710297%
Output for 5.4.10
array_walk 0.15324187278748, array_map 0.29138684272766, 47.409474170836%
Output for 5.4.9
array_walk 0.13619589805603, array_map 0.31135010719299, 56.256350998586%
Output for 5.4.8
array_walk 0.13527393341064, array_map 0.31096720695496, 56.498971471857%
Output for 5.4.7
array_walk 0.13335418701172, array_map 0.30295395851135, 55.982028534306%
Output for 5.4.6
array_walk 0.1373450756073, array_map 0.31301307678223, 56.121617339695%
Output for 5.4.5
array_walk 0.16578316688538, array_map 0.29194188117981, 43.213640257641%
Output for 5.4.4
array_walk 0.1627950668335, array_map 0.2920401096344, 44.25592188782%
Output for 5.4.3
array_walk 0.17949795722961, array_map 0.41371393203735, 56.613025733586%
Output for 5.4.2
array_walk 0.14912891387939, array_map 0.30735111236572, 51.479299120953%
Output for 5.4.1
array_walk 0.1628270149231, array_map 0.2945020198822, 44.711070237065%
Output for 5.4.0
array_walk 0.15197491645813, array_map 0.31029415130615, 51.022307117809%
Output for 5.3.29
array_walk 0.14080595970154, array_map 0.24176502227783, 41.759168313551%
Output for 5.3.28
array_walk 0.15721392631531, array_map 0.24269104003906, 35.220547783716%
Output for 5.3.27
array_walk 0.16247987747192, array_map 0.24377393722534, 33.348134209389%
Output for 5.3.26
array_walk 0.15192103385925, array_map 0.2433009147644, 37.558379504507%
Output for 5.3.25
array_walk 0.15100693702698, array_map 0.24388408660889, 38.082496842385%
Output for 5.3.24
array_walk 0.18842911720276, array_map 0.3185760974884, 40.852713468368%
Output for 5.3.23
array_walk 0.15278792381287, array_map 0.23641014099121, 35.371670956134%
Output for 5.3.22
array_walk 0.16628003120422, array_map 0.23842716217041, 30.259610654016%
Output for 5.3.21
array_walk 0.1403501033783, array_map 0.19991612434387, 29.795506070895%
Output for 5.3.20
array_walk 0.15079212188721, array_map 0.24150586128235, 37.561713373526%
Output for 5.3.19
array_walk 0.14153790473938, array_map 0.22859597206116, 38.083815098232%
Output for 5.3.18
array_walk 0.15226602554321, array_map 0.23748803138733, 35.884758211299%
Output for 5.3.17
array_walk 0.15874791145325, array_map 0.23932600021362, 33.668756711954%
Output for 5.3.16
array_walk 0.1734778881073, array_map 0.23061203956604, 24.775008089887%
Output for 5.3.15
array_walk 0.1496410369873, array_map 0.24664092063904, 39.328382086967%
Output for 5.3.14
array_walk 0.16089606285095, array_map 0.23982095718384, 32.909923828043%
Output for 5.3.13
array_walk 0.1638069152832, array_map 0.24058198928833, 31.912228439143%
Output for 5.3.12
array_walk 0.15332388877869, array_map 0.24115180969238, 36.420179067174%
Output for 5.3.11
array_walk 0.14582204818726, array_map 0.23582196235657, 38.164347913122%
Output for 5.3.10
array_walk 0.16674900054932, array_map 0.26157712936401, 36.252454121374%
Output for 5.3.9
array_walk 0.15856099128723, array_map 0.2576220035553, 38.452077423893%
Output for 5.3.8
array_walk 0.14794111251831, array_map 0.25619196891785, 42.253805557132%
Output for 5.3.7
array_walk 0.15002703666687, array_map 0.2585871219635, 41.982015373509%
Output for 5.3.6
array_walk 0.17651295661926, array_map 0.25830602645874, 31.665180623474%
Output for 5.3.5
array_walk 0.17346382141113, array_map 0.26109385490417, 33.562656434485%
Output for 5.3.4
array_walk 0.1671199798584, array_map 0.25652623176575, 34.852674243854%
Output for 5.3.3
array_walk 0.16596102714539, array_map 0.25727295875549, 35.492238302778%
Output for 5.3.2
array_walk 0.15904784202576, array_map 0.29883790016174, 46.777887965458%
Output for 5.3.1
array_walk 0.15186405181885, array_map 0.26271200180054, 42.1937137329%
Output for 5.3.0
array_walk 0.1812801361084, array_map 0.23812007904053, 23.870285597568%
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/lD69M 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/lD69M on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/lD69M on line 5
Process exited with code 255.