3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = range(0,100000); $t = microtime(1); array_map(function($v) { $v++; }, $a); $t = microtime(1) - $t; echo "map func: $t\n"; $a = range(0,100000); $t = microtime(1); $func = function($v) { $v++; }; array_map($func, $a); $t = microtime(1) - $t; echo "map var func: $t\n"; $a = range(0,100000); $t = microtime(1); array_walk($a, function($v) { $v++; }); $t = microtime(1) - $t; echo "walk func: $t\n"; $a = range(0,100000); $t = microtime(1); $func = function($v) { $v++; }; array_walk($a, $func); $t = microtime(1) - $t; echo "walk var func: $t\n";
Output for 7.1.0
map func: 0.0070300102233887 map var func: 0.0068140029907227 walk func: 0.010220050811768 walk var func: 0.0095410346984863
Output for 7.0.14
map func: 0.0076029300689697 map var func: 0.0072088241577148 walk func: 0.008026123046875 walk var func: 0.0077278614044189
Output for 7.0.6
map func: 0.010763883590698 map var func: 0.010264873504639 walk func: 0.0091218948364258 walk var func: 0.00872802734375
Output for 7.0.5
map func: 0.0074319839477539 map var func: 0.0071418285369873 walk func: 0.0066859722137451 walk var func: 0.0066609382629395
Output for 7.0.4
map func: 0.0071480274200439 map var func: 0.0068631172180176 walk func: 0.0069150924682617 walk var func: 0.0067920684814453
Output for 7.0.3
map func: 0.012975931167603 map var func: 0.012151002883911 walk func: 0.0070779323577881 walk var func: 0.0069839954376221
Output for 7.0.2
map func: 0.013436079025269 map var func: 0.013223171234131 walk func: 0.006458044052124 walk var func: 0.0064840316772461
Output for 7.0.1
map func: 0.007105827331543 map var func: 0.0068209171295166 walk func: 0.0062761306762695 walk var func: 0.006256103515625
Output for 7.0.0
map func: 0.012419939041138 map var func: 0.010313034057617 walk func: 0.010124921798706 walk var func: 0.010964870452881
Output for 5.6.28
map func: 0.044888973236084 map var func: 0.038089036941528 walk func: 0.016856908798218 walk var func: 0.015892028808594
Output for 5.6.21
map func: 0.043105125427246 map var func: 0.035359859466553 walk func: 0.013942003250122 walk var func: 0.013952970504761
Output for 5.6.20
map func: 0.031476974487305 map var func: 0.031149864196777 walk func: 0.014365911483765 walk var func: 0.01415491104126
Output for 5.6.19
map func: 0.031388998031616 map var func: 0.030899047851562 walk func: 0.013377904891968 walk var func: 0.014429807662964
Output for 5.6.18
map func: 0.035690069198608 map var func: 0.032127857208252 walk func: 0.013818025588989 walk var func: 0.014025926589966
Output for 5.6.17
map func: 0.041819095611572 map var func: 0.032425880432129 walk func: 0.013720035552979 walk var func: 0.013670206069946
Output for 5.6.16
map func: 0.039712190628052 map var func: 0.03351902961731 walk func: 0.014489889144897 walk var func: 0.014465808868408
Output for 5.6.15
map func: 0.043616056442261 map var func: 0.035485029220581 walk func: 0.014281034469604 walk var func: 0.01432204246521
Output for 5.6.14
map func: 0.031708955764771 map var func: 0.031183004379272 walk func: 0.014279127120972 walk var func: 0.014296054840088
Output for 5.6.13
map func: 0.049582958221436 map var func: 0.049167156219482 walk func: 0.027032852172852 walk var func: 0.027040958404541
Output for 5.6.12
map func: 0.032287836074829 map var func: 0.032042980194092 walk func: 0.014297962188721 walk var func: 0.014394998550415
Output for 5.6.11
map func: 0.044717073440552 map var func: 0.03612208366394 walk func: 0.013864040374756 walk var func: 0.013852119445801
Output for 5.6.10
map func: 0.043569087982178 map var func: 0.035437107086182 walk func: 0.014218091964722 walk var func: 0.014263868331909
Output for 5.6.9
map func: 0.034363031387329 map var func: 0.031962156295776 walk func: 0.01382303237915 walk var func: 0.013826847076416
Output for 5.6.8
map func: 0.034544944763184 map var func: 0.033069849014282 walk func: 0.014350175857544 walk var func: 0.014364004135132
Output for 5.5.35
map func: 0.026332139968872 map var func: 0.025703907012939 walk func: 0.011080026626587 walk var func: 0.011091947555542
Output for 5.5.34
map func: 0.038275957107544 map var func: 0.032630920410156 walk func: 0.013000011444092 walk var func: 0.01347804069519
Output for 5.5.33
map func: 0.033853769302368 map var func: 0.032692909240723 walk func: 0.013267993927002 walk var func: 0.013236999511719
Output for 5.5.32
map func: 0.044250011444092 map var func: 0.037071943283081 walk func: 0.013785839080811 walk var func: 0.013689994812012
Output for 5.5.31
map func: 0.03776478767395 map var func: 0.032290935516357 walk func: 0.013239145278931 walk var func: 0.013346195220947
Output for 5.5.30
map func: 0.032027006149292 map var func: 0.03095006942749 walk func: 0.013339996337891 walk var func: 0.013084173202515
Output for 5.5.29
map func: 0.043058156967163 map var func: 0.035006046295166 walk func: 0.013327121734619 walk var func: 0.013209104537964
Output for 5.5.28
map func: 0.03386402130127 map var func: 0.032419919967651 walk func: 0.01318883895874 walk var func: 0.013295888900757
Output for 5.5.27
map func: 0.032537937164307 map var func: 0.031726121902466 walk func: 0.013353109359741 walk var func: 0.013268947601318
Output for 5.5.26
map func: 0.032698154449463 map var func: 0.031651020050049 walk func: 0.013911962509155 walk var func: 0.013288974761963
Output for 5.5.25
map func: 0.047292947769165 map var func: 0.038725852966309 walk func: 0.016150951385498 walk var func: 0.016211986541748
Output for 5.5.24
map func: 0.042279958724976 map var func: 0.034438848495483 walk func: 0.013186931610107 walk var func: 0.013156890869141
Output for 5.4.45
map func: 0.20127296447754 map var func: 0.13701200485229 walk func: 0.030241966247559 walk var func: 0.051298141479492
Output for 5.4.44
map func: 0.045742988586426 map var func: 0.043559074401855 walk func: 0.016223907470703 walk var func: 0.017686128616333
Output for 5.4.43
map func: 0.027661800384521 map var func: 0.028808832168579 walk func: 0.023184061050415 walk var func: 0.02288293838501
Output for 5.4.42
map func: 0.062662124633789 map var func: 0.084042072296143 walk func: 0.012120008468628 walk var func: 0.011727094650269
Output for 5.4.41
map func: 0.096704006195068 map var func: 0.099094867706299 walk func: 0.072360992431641 walk var func: 0.049898862838745
Output for 5.4.40
map func: 0.057557106018066 map var func: 0.046457052230835 walk func: 0.011311054229736 walk var func: 0.015187978744507
Output for 5.4.39
map func: 0.04364800453186 map var func: 0.088618040084839 walk func: 0.02484393119812 walk var func: 0.020241022109985
Output for 5.4.38
map func: 0.11540389060974 map var func: 0.13691782951355 walk func: 0.049208164215088 walk var func: 0.04078197479248
Output for 5.4.37
map func: 0.074373960494995 map var func: 0.10021710395813 walk func: 0.045065879821777 walk var func: 0.045773983001709
Output for 5.4.36
map func: 0.054939985275269 map var func: 0.079759836196899 walk func: 0.032321929931641 walk var func: 0.022715091705322
Output for 5.4.35
map func: 0.1099898815155 map var func: 0.056797981262207 walk func: 0.022887945175171 walk var func: 0.022903919219971
Output for 5.4.34
map func: 0.0680091381073 map var func: 0.066500186920166 walk func: 0.051594018936157 walk var func: 0.023928880691528
Output for 5.4.32
map func: 0.033882856369019 map var func: 0.039569854736328 walk func: 0.021083116531372 walk var func: 0.015107870101929
Output for 5.4.31
map func: 0.033209800720215 map var func: 0.033681154251099 walk func: 0.021965026855469 walk var func: 0.015437126159668
Output for 5.4.30
map func: 0.040612936019897 map var func: 0.033061027526855 walk func: 0.015613079071045 walk var func: 0.021870851516724
Output for 5.4.29
map func: 0.034051179885864 map var func: 0.033222913742065 walk func: 0.015643119812012 walk var func: 0.015918016433716
Output for 5.4.28
map func: 0.035378217697144 map var func: 0.040520906448364 walk func: 0.016633033752441 walk var func: 0.016055107116699
Output for 5.4.27
map func: 0.034358024597168 map var func: 0.034362077713013 walk func: 0.017242908477783 walk var func: 0.036833047866821
Output for 5.4.26
map func: 0.035928010940552 map var func: 0.034751892089844 walk func: 0.01559591293335 walk var func: 0.015695095062256
Output for 5.4.25
map func: 0.035063028335571 map var func: 0.035364151000977 walk func: 0.01610803604126 walk var func: 0.021384000778198
Output for 5.4.24
map func: 0.035011768341064 map var func: 0.034752130508423 walk func: 0.015449047088623 walk var func: 0.015737056732178
Output for 5.4.23
map func: 0.047672033309937 map var func: 0.034375905990601 walk func: 0.01590895652771 walk var func: 0.015049934387207
Output for 5.4.22
map func: 0.035254955291748 map var func: 0.035446166992188 walk func: 0.015857219696045 walk var func: 0.015905141830444
Output for 5.4.21
map func: 0.066205978393555 map var func: 0.05329704284668 walk func: 0.015344142913818 walk var func: 0.016290903091431
Output for 5.4.20
map func: 0.035218954086304 map var func: 0.035361051559448 walk func: 0.015673160552979 walk var func: 0.014748096466064
Output for 5.4.19
map func: 0.034315824508667 map var func: 0.034523010253906 walk func: 0.016048908233643 walk var func: 0.015738010406494
Output for 5.4.18
map func: 0.035165071487427 map var func: 0.034662961959839 walk func: 0.015512943267822 walk var func: 0.015905857086182
Output for 5.4.17
map func: 0.035603046417236 map var func: 0.034754991531372 walk func: 0.015381097793579 walk var func: 0.015341997146606
Output for 5.4.16
map func: 0.038647890090942 map var func: 0.033128976821899 walk func: 0.016319990158081 walk var func: 0.015630006790161
Output for 5.4.15
map func: 0.034399032592773 map var func: 0.039875984191895 walk func: 0.015318870544434 walk var func: 0.016418933868408
Output for 5.4.14
map func: 0.034728050231934 map var func: 0.034064054489136 walk func: 0.015303134918213 walk var func: 0.015336036682129
Output for 5.4.13
map func: 0.034607887268066 map var func: 0.03397798538208 walk func: 0.015573978424072 walk var func: 0.015886068344116
Output for 5.4.12
map func: 0.04085111618042 map var func: 0.051934003829956 walk func: 0.030673027038574 walk var func: 0.022005081176758
Output for 5.4.11
map func: 0.036934852600098 map var func: 0.035484075546265 walk func: 0.016335964202881 walk var func: 0.016102075576782
Output for 5.4.10
map func: 0.03596019744873 map var func: 0.047115087509155 walk func: 0.016209125518799 walk var func: 0.016206979751587
Output for 5.4.9
map func: 0.035538911819458 map var func: 0.038547039031982 walk func: 0.016716957092285 walk var func: 0.016227960586548
Output for 5.4.8
map func: 0.035620927810669 map var func: 0.035852909088135 walk func: 0.01601505279541 walk var func: 0.016510009765625
Output for 5.4.7
map func: 0.035253047943115 map var func: 0.03526782989502 walk func: 0.016283988952637 walk var func: 0.01640510559082
Output for 5.4.6
map func: 0.036581039428711 map var func: 0.036577939987183 walk func: 0.016886949539185 walk var func: 0.035676002502441
Output for 5.4.5
map func: 0.035093069076538 map var func: 0.03780198097229 walk func: 0.016622066497803 walk var func: 0.016694068908691
Output for 5.4.4
map func: 0.041265964508057 map var func: 0.034970998764038 walk func: 0.016587972640991 walk var func: 0.01621413230896
Output for 5.4.3
map func: 0.035828113555908 map var func: 0.03522515296936 walk func: 0.016480922698975 walk var func: 0.016776084899902
Output for 5.4.2
map func: 0.035322904586792 map var func: 0.034088850021362 walk func: 0.016735076904297 walk var func: 0.01633620262146
Output for 5.4.1
map func: 0.035240173339844 map var func: 0.035421848297119 walk func: 0.016487121582031 walk var func: 0.016540050506592
Output for 5.4.0
map func: 0.035465002059937 map var func: 0.034544944763184 walk func: 0.015216112136841 walk var func: 0.015773057937622
Output for 5.3.29
map func: 0.034548044204712 map var func: 0.032531976699829 walk func: 0.016191959381104 walk var func: 0.01615309715271
Output for 5.3.28
map func: 0.033679962158203 map var func: 0.03146505355835 walk func: 0.015956878662109 walk var func: 0.016699075698853
Output for 5.3.27
map func: 0.036246061325073 map var func: 0.033336162567139 walk func: 0.015839099884033 walk var func: 0.016489028930664
Output for 5.3.26
map func: 0.036404132843018 map var func: 0.032803058624268 walk func: 0.016863107681274 walk var func: 0.016891956329346
Output for 5.3.25
map func: 0.034237861633301 map var func: 0.032450914382935 walk func: 0.016506195068359 walk var func: 0.031860113143921
Output for 5.3.24
map func: 0.035146951675415 map var func: 0.048506021499634 walk func: 0.016314029693604 walk var func: 0.016293048858643
Output for 5.3.23
map func: 0.041528940200806 map var func: 0.032221078872681 walk func: 0.016639947891235 walk var func: 0.020361185073853
Output for 5.3.22
map func: 0.034360885620117 map var func: 0.031767845153809 walk func: 0.017397880554199 walk var func: 0.016695976257324
Output for 5.3.21
map func: 0.035191059112549 map var func: 0.032299041748047 walk func: 0.01701021194458 walk var func: 0.016886949539185
Output for 5.3.20
map func: 0.035768032073975 map var func: 0.03261399269104 walk func: 0.016627073287964 walk var func: 0.016875982284546
Output for 5.3.19
map func: 0.036062955856323 map var func: 0.032205104827881 walk func: 0.016555070877075 walk var func: 0.031975984573364
Output for 5.3.18
map func: 0.033976078033447 map var func: 0.036965847015381 walk func: 0.02307915687561 walk var func: 0.016168832778931
Output for 5.3.17
map func: 0.034938097000122 map var func: 0.031906843185425 walk func: 0.016148805618286 walk var func: 0.017007112503052
Output for 5.3.16
map func: 0.034910917282104 map var func: 0.032829999923706 walk func: 0.017235994338989 walk var func: 0.016749858856201
Output for 5.3.15
map func: 0.046650886535645 map var func: 0.033865928649902 walk func: 0.018841028213501 walk var func: 0.019106864929199
Output for 5.3.14
map func: 0.03537392616272 map var func: 0.032982110977173 walk func: 0.016654968261719 walk var func: 0.016415119171143
Output for 5.3.13
map func: 0.034631967544556 map var func: 0.031923055648804 walk func: 0.026803970336914 walk var func: 0.023205995559692
Output for 5.3.12
map func: 0.034409999847412 map var func: 0.03184986114502 walk func: 0.016600131988525 walk var func: 0.016597986221313
Output for 5.3.11
map func: 0.038119077682495 map var func: 0.031102895736694 walk func: 0.016272068023682 walk var func: 0.015971183776855
Output for 5.3.10
map func: 0.04182505607605 map var func: 0.040328025817871 walk func: 0.017764806747437 walk var func: 0.016819953918457
Output for 5.3.9
map func: 0.038046836853027 map var func: 0.034831047058105 walk func: 0.017210006713867 walk var func: 0.017385005950928
Output for 5.3.8
map func: 0.034901142120361 map var func: 0.033281087875366 walk func: 0.018218040466309 walk var func: 0.016252040863037
Output for 5.3.7
map func: 0.035859823226929 map var func: 0.033936023712158 walk func: 0.020684003829956 walk var func: 0.026267051696777
Output for 5.3.6
map func: 0.03441596031189 map var func: 0.031502962112427 walk func: 0.016161203384399 walk var func: 0.016306161880493
Output for 5.3.5
map func: 0.035974025726318 map var func: 0.034859895706177 walk func: 0.015559911727905 walk var func: 0.018445014953613
Output for 5.3.4
map func: 0.035029888153076 map var func: 0.0328688621521 walk func: 0.017086982727051 walk var func: 0.018558025360107
Output for 5.3.3
map func: 0.038005113601685 map var func: 0.032891988754272 walk func: 0.015363216400146 walk var func: 0.015653848648071
Output for 5.3.2
map func: 0.040103912353516 map var func: 0.032655000686646 walk func: 0.016539096832275 walk var func: 0.016682147979736
Output for 5.3.1
map func: 0.036005973815918 map var func: 0.032979965209961 walk func: 0.031208038330078 walk var func: 0.017945051193237
Output for 5.3.0
map func: 0.035856008529663 map var func: 0.029438972473145 walk func: 0.016077041625977 walk var func: 0.016292095184326
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/pS1AR 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, expecting ')' in /in/pS1AR on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/pS1AR on line 5
Process exited with code 255.