3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tmp = $array = range(1, 1000); $t = microtime(1); for ($i = 0; $i < 1e4; $i++) foreach ($array as &$value) $value++; print "by ref: ".(microtime(1) - $t)."\n"; $array = $tmp; // reset $t = microtime(1); for ($i = 0; $i < 1e4; $i++) foreach ($array as $key => $value) $array[$key]++; print "by array[key]: ".(microtime(1) - $t)."\n";
Output for 7.1.0
by ref: 0.24187302589417 by array[key]: -0.2512059211731
Output for 7.0.14
by ref: 0.22590804100037 by array[key]: 0.2646279335022
Output for 7.0.10
by ref: 0.21518301963806 by array[key]: 0.27723002433777
Output for 7.0.9
by ref: 0.20124197006226 by array[key]: 0.29475498199463
Output for 7.0.8
by ref: 0.22054100036621 by array[key]: 0.27926588058472
Output for 7.0.7
by ref: 0.22122097015381 by array[key]: 0.29059410095215
Output for 7.0.6
by ref: 0.24300718307495 by array[key]: 0.275395154953
Output for 7.0.5
by ref: 0.22652411460876 by array[key]: 0.27974510192871
Output for 7.0.4
by ref: 0.2004611492157 by array[key]: 0.2281801700592
Output for 7.0.3
by ref: 0.18538904190063 by array[key]: 0.22871208190918
Output for 7.0.2
by ref: 0.22695302963257 by array[key]: 0.27801394462585
Output for 7.0.1
by ref: 0.19711399078369 by array[key]: 0.25197601318359
Output for 7.0.0
by ref: 0.19706892967224 by array[key]: 0.23051404953003
Output for hhvm-3.12.0
by ref: 0.58825302124023 by array[key]: 1.067106962204
Output for hhvm-3.10.0
by ref: 0.72249794006348 by array[key]: 1.3086178302765
Output for 5.6.28
by ref: 0.44799995422363 by array[key]: 0.91849994659424
Output for 5.6.25
by ref: 0.34932208061218 by array[key]: 0.78294396400452
Output for 5.6.24
by ref: 0.34265208244324 by array[key]: 0.80889797210693
Output for 5.6.23
by ref: 0.33659601211548 by array[key]: 0.76445388793945
Output for 5.6.22
by ref: 0.36682891845703 by array[key]: 0.90192604064941
Output for 5.6.21
by ref: 0.39650797843933 by array[key]: 0.82718896865845
Output for 5.6.20
by ref: 0.36329007148743 by array[key]: 0.80809211730957
Output for 5.6.19
by ref: 0.36656403541565 by array[key]: 0.81572389602661
Output for 5.6.18
by ref: 0.28075909614563 by array[key]: 0.71293711662292
Output for 5.6.17
by ref: 0.31083488464355 by array[key]: 0.78919792175293
Output for 5.6.16
by ref: 0.39263820648193 by array[key]: 1.0045480728149
Output for 5.6.15
by ref: 0.29478192329407 by array[key]: 0.71679997444153
Output for 5.6.14
by ref: 0.36214303970337 by array[key]: 0.77564096450806
Output for 5.6.13
by ref: 0.35310292243958 by array[key]: 0.77854895591736
Output for 5.6.12
by ref: 0.30775499343872 by array[key]: 0.77649807929993
Output for 5.6.11
by ref: 0.31984210014343 by array[key]: 0.78426504135132
Output for 5.6.10
by ref: 0.31778001785278 by array[key]: 0.70834898948669
Output for 5.6.9
by ref: 0.30992007255554 by array[key]: 0.76913499832153
Output for 5.6.8
by ref: 0.42306184768677 by array[key]: 0.79266810417175
Output for 5.6.7
by ref: 0.33949494361877 by array[key]: 0.69557309150696
Output for 5.6.6
by ref: 0.40908718109131 by array[key]: 0.78746795654297
Output for 5.6.5
by ref: 0.42831897735596 by array[key]: 0.78660011291504
Output for 5.6.4
by ref: 0.43091511726379 by array[key]: 0.80609202384949
Output for 5.6.3
by ref: 0.37528491020203 by array[key]: 0.78984498977661
Output for 5.6.2
by ref: 0.29201698303223 by array[key]: 0.7047700881958
Output for 5.6.1
by ref: 0.32350206375122 by array[key]: 0.74704122543335
Output for 5.6.0
by ref: 0.29280781745911 by array[key]: 0.70626211166382
Output for 5.5.38
by ref: 0.3468861579895 by array[key]: 0.72482204437256
Output for 5.5.37
by ref: 0.37272500991821 by array[key]: 0.83029007911682
Output for 5.5.36
by ref: 0.35443305969238 by array[key]: 0.81238102912903
Output for 5.5.35
by ref: 0.38517713546753 by array[key]: 0.7544629573822
Output for 5.5.34
by ref: 0.36740207672119 by array[key]: 0.81275486946106
Output for 5.5.33
by ref: 0.3001720905304 by array[key]: 0.75683403015137
Output for 5.5.32
by ref: 0.28396987915039 by array[key]: 0.73763108253479
Output for 5.5.31
by ref: 0.40436291694641 by array[key]: 0.8495819568634
Output for 5.5.30
by ref: 0.33846187591553 by array[key]: 0.72180795669556
Output for 5.5.29
by ref: 0.39888310432434 by array[key]: 1.0347878932953
Output for 5.5.28
by ref: 0.28255319595337 by array[key]: 0.72233891487122
Output for 5.5.27
by ref: 0.37990808486938 by array[key]: 1.0414698123932
Output for 5.5.26
by ref: 0.31635403633118 by array[key]: 0.80291295051575
Output for 5.5.25
by ref: 0.31885600090027 by array[key]: 0.79223394393921
Output for 5.5.24
by ref: 0.35182499885559 by array[key]: 0.81647515296936
Output for 5.5.23
by ref: 0.42736983299255 by array[key]: 0.81668019294739
Output for 5.5.22
by ref: 0.34959983825684 by array[key]: 0.76928400993347
Output for 5.5.21
by ref: 0.3621768951416 by array[key]: 0.81020283699036
Output for 5.5.20
by ref: 0.39203786849976 by array[key]: 0.96812105178833
Output for 5.5.19
by ref: 0.35914516448975 by array[key]: 0.82338809967041
Output for 5.5.18
by ref: 0.34577202796936 by array[key]: 0.76614594459534
Output for 5.5.16
by ref: 0.28747081756592 by array[key]: 0.71367883682251
Output for 5.5.15
by ref: 0.36072397232056 by array[key]: 0.79015898704529
Output for 5.5.14
by ref: 0.3659188747406 by array[key]: 0.79065704345703
Output for 5.5.13
by ref: 0.37136197090149 by array[key]: 0.81070613861084
Output for 5.5.12
by ref: 0.36819100379944 by array[key]: 0.81101703643799
Output for 5.5.11
by ref: 0.31231498718262 by array[key]: 0.78701591491699
Output for 5.5.10
by ref: 0.36395597457886 by array[key]: 0.71875
Output for 5.5.9
by ref: 0.38745808601379 by array[key]: 0.78519797325134
Output for 5.5.8
by ref: 0.37490892410278 by array[key]: 0.79461789131165
Output for 5.5.7
by ref: 0.36450910568237 by array[key]: 0.85025095939636
Output for 5.5.6
by ref: 0.41296601295471 by array[key]: 0.89407992362976
Output for 5.5.5
by ref: 0.36751317977905 by array[key]: 0.8542640209198
Output for 5.5.4
by ref: 0.41265296936035 by array[key]: 0.82840991020203
Output for 5.5.3
by ref: 0.39607691764832 by array[key]: 0.79979705810547
Output for 5.5.2
by ref: 0.38939380645752 by array[key]: 0.80390095710754
Output for 5.5.1
by ref: 0.35642194747925 by array[key]: 0.80421209335327
Output for 5.5.0
by ref: 0.37516498565674 by array[key]: 0.82828807830811
Output for 5.4.45
by ref: 0.4515540599823 by array[key]: 0.80745720863342
Output for 5.4.44
by ref: 0.44257616996765 by array[key]: 0.74431681632996
Output for 5.4.43
by ref: 0.41535401344299 by array[key]: 0.79889297485352
Output for 5.4.42
by ref: 0.33262515068054 by array[key]: 0.78589510917664
Output for 5.4.41
by ref: 0.40738391876221 by array[key]: 0.81616401672363
Output for 5.4.40
by ref: 0.41860008239746 by array[key]: 0.7898211479187
Output for 5.4.39
by ref: 0.38495993614197 by array[key]: 0.71484589576721
Output for 5.4.38
by ref: 0.4522168636322 by array[key]: 0.78222298622131
Output for 5.4.37
by ref: 0.35473203659058 by array[key]: 0.89321994781494
Output for 5.4.36
by ref: 0.42605710029602 by array[key]: 0.82301998138428
Output for 5.4.35
by ref: 0.37891387939453 by array[key]: 0.92862010002136
Output for 5.4.34
by ref: 0.30994200706482 by array[key]: 0.73271203041077
Output for 5.4.32
by ref: 0.38873195648193 by array[key]: 0.78913998603821
Output for 5.4.31
by ref: 0.40171599388123 by array[key]: 0.80268692970276
Output for 5.4.30
by ref: 0.40224289894104 by array[key]: 0.80210208892822
Output for 5.4.29
by ref: 0.36667895317078 by array[key]: 0.74266695976257
Output for 5.4.28
by ref: 0.32992792129517 by array[key]: 0.79002094268799
Output for 5.4.27
by ref: 0.34719491004944 by array[key]: 0.74368500709534
Output for 5.4.26
by ref: 0.37089014053345 by array[key]: 0.79389405250549
Output for 5.4.25
by ref: 0.38104391098022 by array[key]: 0.85916113853455
Output for 5.4.24
by ref: 0.36612796783447 by array[key]: 0.83589482307434
Output for 5.4.23
by ref: 0.3765881061554 by array[key]: 0.78601288795471
Output for 5.4.22
by ref: 0.30717706680298 by array[key]: 0.77287101745605
Output for 5.4.21
by ref: 0.38789701461792 by array[key]: 0.82364201545715
Output for 5.4.20
by ref: 0.38383889198303 by array[key]: 0.81315302848816
Output for 5.4.19
by ref: 0.39177107810974 by array[key]: 0.76481604576111
Output for 5.4.18
by ref: 0.39940810203552 by array[key]: 0.81288504600525
Output for 5.4.17
by ref: 0.29043793678284 by array[key]: 0.71441698074341
Output for 5.4.16
by ref: 0.38220286369324 by array[key]: 0.81356120109558
Output for 5.4.15
by ref: 0.38937997817993 by array[key]: 0.81724691390991
Output for 5.4.14
by ref: 0.3867359161377 by array[key]: 0.86913704872131
Output for 5.4.13
by ref: 0.41109395027161 by array[key]: 0.84896802902222
Output for 5.4.12
by ref: 0.29159092903137 by array[key]: 0.72910690307617
Output for 5.4.11
by ref: 0.39955186843872 by array[key]: 0.80823302268982
Output for 5.4.10
by ref: 0.45292592048645 by array[key]: 0.7818238735199
Output for 5.4.9
by ref: 0.41427397727966 by array[key]: 0.70917510986328
Output for 5.4.8
by ref: 0.45865607261658 by array[key]: 0.7374529838562
Output for 5.4.7
by ref: 0.50228095054626 by array[key]: 0.83951497077942
Output for 5.4.6
by ref: 0.39996600151062 by array[key]: 0.78623604774475
Output for 5.4.5
by ref: 0.38933086395264 by array[key]: 0.77333903312683
Output for 5.4.4
by ref: 0.38057899475098 by array[key]: 0.75245904922485
Output for 5.4.3
by ref: 0.4519579410553 by array[key]: 0.8602511882782
Output for 5.4.2
by ref: 0.28961205482483 by array[key]: 0.73076987266541
Output for 5.4.1
by ref: 0.40810704231262 by array[key]: 0.80805897712708
Output for 5.4.0
by ref: 0.35204696655273 by array[key]: 0.75537800788879
Output for 5.3.29
by ref: 0.45536589622498 by array[key]: 0.94415307044983
Output for 5.3.28
by ref: 0.36126208305359 by array[key]: 0.88035297393799
Output for 5.3.27
by ref: 0.44815897941589 by array[key]: 0.96398782730103
Output for 5.3.26
by ref: 0.43279099464417 by array[key]: 0.88707494735718
Output for 5.3.25
by ref: 0.35753583908081 by array[key]: 0.81902289390564
Output for 5.3.24
by ref: 0.39956593513489 by array[key]: 0.82906007766724
Output for 5.3.23
by ref: 0.37562012672424 by array[key]: 0.96811985969543
Output for 5.3.22
by ref: 0.33650612831116 by array[key]: 0.84593605995178
Output for 5.3.21
by ref: 0.43422603607178 by array[key]: 1.0155129432678
Output for 5.3.20
by ref: 0.44307112693787 by array[key]: 0.91705393791199
Output for 5.3.19
by ref: 0.41157007217407 by array[key]: 0.8420729637146
Output for 5.3.18
by ref: 0.4459490776062 by array[key]: 0.90564489364624
Output for 5.3.17
by ref: 0.42054510116577 by array[key]: 0.88085198402405
Output for 5.3.16
by ref: 0.47846913337708 by array[key]: 0.91896414756775
Output for 5.3.15
by ref: 0.46327900886536 by array[key]: 0.94878697395325
Output for 5.3.14
by ref: 0.42802906036377 by array[key]: 0.8414511680603
Output for 5.3.13
by ref: 0.42978096008301 by array[key]: 0.85885810852051
Output for 5.3.12
by ref: 0.41207122802734 by array[key]: 0.85466814041138
Output for 5.3.11
by ref: 0.41810894012451 by array[key]: 0.87787580490112
Output for 5.3.10
by ref: 0.34684085845947 by array[key]: 0.82135677337646
Output for 5.3.9
by ref: 0.36638903617859 by array[key]: 0.91952705383301
Output for 5.3.8
by ref: 0.37454795837402 by array[key]: 0.89439511299133
Output for 5.3.7
by ref: 0.43280696868896 by array[key]: 0.89128684997559
Output for 5.3.6
by ref: 0.38283395767212 by array[key]: 0.81419491767883
Output for 5.3.5
by ref: 0.37732005119324 by array[key]: 0.90605092048645
Output for 5.3.4
by ref: 0.43166279792786 by array[key]: 0.86484313011169
Output for 5.3.3
by ref: 0.40170192718506 by array[key]: 0.8535749912262
Output for 5.3.2
by ref: 0.42350101470947 by array[key]: 0.83239889144897
Output for 5.3.1
by ref: 0.46042394638062 by array[key]: 0.90555095672607
Output for 5.3.0
by ref: 0.36712408065796 by array[key]: 0.83227300643921
Output for 5.2.17
by ref: 0.54271578788757 by array[key]: 1.0154070854187
Output for 5.2.16
by ref: 0.52176690101624 by array[key]: 1.0101342201233
Output for 5.2.15
by ref: 0.53055095672607 by array[key]: 1.042680978775
Output for 5.2.14
by ref: 0.60511898994446 by array[key]: 1.0437650680542
Output for 5.2.13
by ref: 0.50819897651672 by array[key]: 1.0455529689789
Output for 5.2.12
by ref: 0.46582508087158 by array[key]: 0.98243093490601
Output for 5.2.11
by ref: 0.48283004760742 by array[key]: 1.0406441688538
Output for 5.2.10
by ref: 0.4873480796814 by array[key]: 0.93193316459656
Output for 5.2.9
by ref: 0.45255303382874 by array[key]: 1.0513949394226
Output for 5.2.8
by ref: 0.42846083641052 by array[key]: 1.0303819179535
Output for 5.2.7
by ref: 0.4842689037323 by array[key]: 0.98422193527222
Output for 5.2.6
by ref: 0.42865777015686 by array[key]: 1.1249060630798
Output for 5.2.5
by ref: 0.49449992179871 by array[key]: 1.0343201160431
Output for 5.2.4
by ref: 0.51651310920715 by array[key]: 1.0485370159149
Output for 5.2.3
by ref: 0.48728489875793 by array[key]: 1.0848619937897
Output for 5.2.2
by ref: 0.49269413948059 by array[key]: 1.1993908882141
Output for 5.2.1
by ref: 0.37945795059204 by array[key]: 1.1519920825958
Output for 5.2.0
by ref: 0.39850497245789 by array[key]: 1.2172629833221
Output for 5.1.6
by ref: 0.40700197219849 by array[key]: 1.1944720745087
Output for 5.1.5
by ref: 0.40865206718445 by array[key]: 1.2152361869812
Output for 5.1.4
by ref: 0.46633100509644 by array[key]: 1.3283479213715
Output for 5.1.3
by ref: 0.39425897598267 by array[key]: 1.2010140419006
Output for 5.1.2
by ref: 0.43056511878967 by array[key]: 1.2882521152496
Output for 5.1.1
by ref: 0.47619819641113 by array[key]: 1.2889730930328
Output for 5.1.0
by ref: 0.49717783927917 by array[key]: 1.5222239494324
Output for 5.0.5
by ref: 1.7694020271301
Process exited with code 137.
Output for 5.0.4

Process exited with code 137.
Output for 5.0.3
by ref: 1.7066850662231
Process exited with code 137.
Output for 5.0.2
by ref: 1.6127779483795
Process exited with code 137.
Output for 5.0.1
by ref: 1.7307360172272
Process exited with code 137.
Output for 5.0.0
by ref: 1.5740671157837
Process exited with code 137.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /in/UY6b9 on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '&', expecting T_VARIABLE or '$' in /in/UY6b9 on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /in/UY6b9 on line 7
Process exited with code 255.