3v4l.org

run code in 300+ PHP versions simultaneously
<?php $classmap1 = array(); for ($i=1; $i<=10000; $i++) { $classmap1['a'.$i] = $i+1; } $classmap2 = array(); for ($i=1; $i<=10000; $i++) { $classmap2['b'.$i] = $i+1; } $startTimeForeach = microtime(true); foreach ($classmap2 as $k => $v) { $classmap1[$k] = $v; } $endTimeForeach = microtime(true); echo "Foreach took " . (($endTimeForeach - $startTimeForeach)*1000) ." microseconds<br />\n";
Output for 7.4.0
Foreach took 1.4758110046387 microseconds<br />
Output for 7.3.12
Foreach took 1.4040470123291 microseconds<br />
Output for 7.3.11
Foreach took 1.4469623565674 microseconds<br />
Output for 7.3.10
Foreach took 1.3971328735352 microseconds<br />
Output for 7.3.9
Foreach took 0.98204612731934 microseconds<br />
Output for 7.3.8
Foreach took 1.0101795196533 microseconds<br />
Output for 7.3.7
Foreach took 0.98419189453125 microseconds<br />
Output for 7.3.6
Foreach took 1.0671615600586 microseconds<br />
Output for 7.3.5
Foreach took 1.0058879852295 microseconds<br />
Output for 7.3.4
Foreach took 1.0738372802734 microseconds<br />
Output for 7.3.3
Foreach took 1.1098384857178 microseconds<br />
Output for 7.3.2
Foreach took 1.0590553283691 microseconds<br />
Output for 7.3.1
Foreach took 0.80013275146484 microseconds<br />
Output for 7.3.0
Foreach took 0.78916549682617 microseconds<br />
Output for 7.2.25
Foreach took 1.3852119445801 microseconds<br />
Output for 7.2.24
Foreach took 1.0240077972412 microseconds<br />
Output for 7.2.23
Foreach took 0.98299980163574 microseconds<br />
Output for 7.2.22
Foreach took 0.97799301147461 microseconds<br />
Output for 7.2.21
Foreach took 1.0120868682861 microseconds<br />
Output for 7.2.20
Foreach took 1.0600090026855 microseconds<br />
Output for 7.2.19
Foreach took 0.92601776123047 microseconds<br />
Output for 7.2.18
Foreach took 1.338005065918 microseconds<br />
Output for 7.2.17
Foreach took 0.95677375793457 microseconds<br />
Output for 7.2.16
Foreach took 0.95701217651367 microseconds<br />
Output for 7.2.15
Foreach took 0.58603286743164 microseconds<br />
Output for 7.2.14
Foreach took 0.56910514831543 microseconds<br />
Output for 7.2.13
Foreach took 0.57005882263184 microseconds<br />
Output for 7.2.12
Foreach took 0.60486793518066 microseconds<br />
Output for 7.2.11
Foreach took 0.55694580078125 microseconds<br />
Output for 7.2.10
Foreach took 0.6260871887207 microseconds<br />
Output for 7.2.9
Foreach took 0.79679489135742 microseconds<br />
Output for 7.2.8
Foreach took 0.56219100952148 microseconds<br />
Output for 7.2.7
Foreach took 0.81014633178711 microseconds<br />
Output for 7.2.6
Foreach took 0.75507164001465 microseconds<br />
Output for 7.2.5
Foreach took 0.63300132751465 microseconds<br />
Output for 7.2.4
Foreach took 0.55503845214844 microseconds<br />
Output for 7.2.3
Foreach took 0.55193901062012 microseconds<br />
Output for 7.2.2
Foreach took 0.63490867614746 microseconds<br />
Output for 7.2.1
Foreach took 0.56195259094238 microseconds<br />
Output for 7.2.0
Foreach took 0.56314468383789 microseconds<br />
Output for 7.1.33
Foreach took 0.99611282348633 microseconds<br />
Output for 7.1.32
Foreach took 1.1248588562012 microseconds<br />
Output for 7.1.31
Foreach took 0.84280967712402 microseconds<br />
Output for 7.0.33, 7.1.30
Foreach took 0.76198577880859 microseconds<br />
Output for 7.1.29
Foreach took 1.2140274047852 microseconds<br />
Output for 7.1.28
Foreach took 0.76913833618164 microseconds<br />
Output for 7.0.27, 7.1.27
Foreach took 0.81396102905273 microseconds<br />
Output for 7.1.26
Foreach took 0.78511238098145 microseconds<br />
Output for 7.1.25
Foreach took 1.2660026550293 microseconds<br />
Output for 7.1.24
Foreach took 0.83589553833008 microseconds<br />
Output for 7.1.23
Foreach took 0.84400177001953 microseconds<br />
Output for 7.1.22
Foreach took 0.82898139953613 microseconds<br />
Output for 7.1.21
Foreach took 0.79989433288574 microseconds<br />
Output for 7.1.20
Foreach took 0.82802772521973 microseconds<br />
Output for 7.0.14, 7.1.19
Foreach took 0.81491470336914 microseconds<br />
Output for 7.1.18
Foreach took 0.91004371643066 microseconds<br />
Output for 7.1.17
Foreach took 0.92792510986328 microseconds<br />
Output for 7.1.16
Foreach took 1.209020614624 microseconds<br />
Output for 7.1.15
Foreach took 0.79107284545898 microseconds<br />
Output for 7.1.14
Foreach took 0.81205368041992 microseconds<br />
Output for 7.1.13
Foreach took 0.91910362243652 microseconds<br />
Output for 7.1.12
Foreach took 1.0929107666016 microseconds<br />
Output for 7.1.11
Foreach took 0.76818466186523 microseconds<br />
Output for 7.1.10
Foreach took 0.80299377441406 microseconds<br />
Output for 7.1.9
Foreach took 0.8080005645752 microseconds<br />
Output for 7.1.8
Foreach took 0.77319145202637 microseconds<br />
Output for 7.1.7
Foreach took 0.78487396240234 microseconds<br />
Output for 7.1.6
Foreach took 0.77104568481445 microseconds<br />
Output for 7.1.5
Foreach took 0.85902214050293 microseconds<br />
Output for 7.0.23, 7.1.4
Foreach took 0.81586837768555 microseconds<br />
Output for 7.0.7, 7.1.3
Foreach took 0.75602531433105 microseconds<br />
Output for 7.1.2
Foreach took 0.79607963562012 microseconds<br />
Output for 7.1.1
Foreach took 0.78320503234863 microseconds<br />
Output for 7.1.0
Foreach took 0.79703330993652 microseconds<br />
Output for 7.0.32
Foreach took 0.75483322143555 microseconds<br />
Output for 7.0.31
Foreach took 1.0077953338623 microseconds<br />
Output for 7.0.13, 7.0.30
Foreach took 0.80704689025879 microseconds<br />
Output for 7.0.21, 7.0.29
Foreach took 0.78010559082031 microseconds<br />
Output for 7.0.28
Foreach took 0.85210800170898 microseconds<br />
Output for 7.0.22, 7.0.26
Foreach took 0.77700614929199 microseconds<br />
Output for 7.0.25
Foreach took 0.78201293945312 microseconds<br />
Output for 7.0.24
Foreach took 1.1308193206787 microseconds<br />
Output for 7.0.20
Foreach took 0.78701972961426 microseconds<br />
Output for 7.0.19
Foreach took 0.85711479187012 microseconds<br />
Output for 7.0.18
Foreach took 0.87094306945801 microseconds<br />
Output for 7.0.17
Foreach took 0.93889236450195 microseconds<br />
Output for 7.0.16
Foreach took 0.75793266296387 microseconds<br />
Output for 7.0.15
Foreach took 0.75197219848633 microseconds<br />
Output for 7.0.12
Foreach took 0.81896781921387 microseconds<br />
Output for 7.0.11
Foreach took 0.86593627929688 microseconds<br />
Output for 7.0.10
Foreach took 0.87904930114746 microseconds<br />
Output for 7.0.9
Foreach took 0.93507766723633 microseconds<br />
Output for 7.0.8
Foreach took 0.86688995361328 microseconds<br />
Output for 7.0.6
Foreach took 1.1081695556641 microseconds<br />
Output for 7.0.5
Foreach took 1.1088848114014 microseconds<br />
Output for 7.0.4
Foreach took 0.96297264099121 microseconds<br />
Output for 7.0.3
Foreach took 0.77605247497559 microseconds<br />
Output for 7.0.2
Foreach took 0.83708763122559 microseconds<br />
Output for 7.0.1
Foreach took 0.77199935913086 microseconds<br />
Output for 7.0.0
Foreach took 0.94699859619141 microseconds<br />
Output for 5.6.40
Foreach took 2.8960704803467 microseconds<br />
Output for 5.6.39
Foreach took 2.9709339141846 microseconds<br />
Output for 5.6.38
Foreach took 2.8111934661865 microseconds<br />
Output for 5.6.37
Foreach took 2.7980804443359 microseconds<br />
Output for 5.6.36
Foreach took 3.4990310668945 microseconds<br />
Output for 5.6.35
Foreach took 3.3040046691895 microseconds<br />
Output for 5.6.34
Foreach took 3.1881332397461 microseconds<br />
Output for 5.5.37, 5.6.33
Foreach took 3.3049583435059 microseconds<br />
Output for 5.6.32
Foreach took 2.953052520752 microseconds<br />
Output for 5.6.31
Foreach took 2.8290748596191 microseconds<br />
Output for 5.6.30
Foreach took 2.8700828552246 microseconds<br />
Output for 5.6.29
Foreach took 2.8750896453857 microseconds<br />
Output for 5.6.28
Foreach took 3.3228397369385 microseconds<br />
Output for 5.6.27
Foreach took 2.842903137207 microseconds<br />
Output for 5.5.22, 5.6.26
Foreach took 2.9001235961914 microseconds<br />
Output for 5.5.20, 5.6.25
Foreach took 3.0660629272461 microseconds<br />
Output for 5.6.24
Foreach took 2.863883972168 microseconds<br />
Output for 5.6.23
Foreach took 2.9139518737793 microseconds<br />
Output for 5.6.22
Foreach took 2.9740333557129 microseconds<br />
Output for 5.6.21
Foreach took 3.4298896789551 microseconds<br />
Output for 5.6.20
Foreach took 2.918004989624 microseconds<br />
Output for 5.6.19
Foreach took 3.5769939422607 microseconds<br />
Output for 5.6.18
Foreach took 2.795934677124 microseconds<br />
Output for 5.6.17
Foreach took 2.8669834136963 microseconds<br />
Output for 5.6.16
Foreach took 3.3690929412842 microseconds<br />
Output for 5.6.15
Foreach took 2.8259754180908 microseconds<br />
Output for 5.6.14
Foreach took 2.8889179229736 microseconds<br />
Output for 5.6.13
Foreach took 2.9261112213135 microseconds<br />
Output for 5.6.12
Foreach took 2.9149055480957 microseconds<br />
Output for 5.6.11
Foreach took 2.8119087219238 microseconds<br />
Output for 5.6.10
Foreach took 2.824068069458 microseconds<br />
Output for 5.6.9
Foreach took 2.763032913208 microseconds<br />
Output for 5.6.8
Foreach took 2.9399394989014 microseconds<br />
Output for 5.6.7
Foreach took 2.8040409088135 microseconds<br />
Output for 5.6.6
Foreach took 2.8791427612305 microseconds<br />
Output for 5.6.5
Foreach took 3.3020973205566 microseconds<br />
Output for 5.6.4
Foreach took 3.88503074646 microseconds<br />
Output for 5.5.16, 5.6.3
Foreach took 3.0829906463623 microseconds<br />
Output for 5.6.2
Foreach took 2.8860569000244 microseconds<br />
Output for 5.6.1
Foreach took 3.0779838562012 microseconds<br />
Output for 5.6.0
Foreach took 3.1411647796631 microseconds<br />
Output for 5.5.38
Foreach took 3.3161640167236 microseconds<br />
Output for 5.5.36
Foreach took 3.0720233917236 microseconds<br />
Output for 5.5.35
Foreach took 3.1211376190186 microseconds<br />
Output for 5.5.34
Foreach took 2.8798580169678 microseconds<br />
Output for 5.5.33
Foreach took 2.8910636901855 microseconds<br />
Output for 5.5.32
Foreach took 3.5538673400879 microseconds<br />
Output for 5.5.31
Foreach took 2.9060840606689 microseconds<br />
Output for 5.5.30
Foreach took 2.8188228607178 microseconds<br />
Output for 5.5.29
Foreach took 2.7799606323242 microseconds<br />
Output for 5.5.28
Foreach took 2.9010772705078 microseconds<br />
Output for 5.5.27
Foreach took 2.8519630432129 microseconds<br />
Output for 5.5.26
Foreach took 3.4201145172119 microseconds<br />
Output for 5.5.25
Foreach took 4.0678977966309 microseconds<br />
Output for 5.5.24
Foreach took 2.9580593109131 microseconds<br />
Output for 5.5.23
Foreach took 2.8660297393799 microseconds<br />
Output for 5.5.21
Foreach took 3.0219554901123 microseconds<br />
Output for 5.5.19
Foreach took 2.9630661010742 microseconds<br />
Output for 5.5.15, 5.5.18
Foreach took 3.0560493469238 microseconds<br />
Output for 5.5.17
Foreach took 2.9821395874023 microseconds<br />
Output for 5.5.14
Foreach took 2.9571056365967 microseconds<br />
Output for 5.5.13
Foreach took 3.1628608703613 microseconds<br />
Output for 5.5.12
Foreach took 2.9170513153076 microseconds<br />
Output for 5.5.11
Foreach took 2.9339790344238 microseconds<br />
Output for 5.5.10
Foreach took 2.8650760650635 microseconds<br />
Output for 5.5.9
Foreach took 2.8400421142578 microseconds<br />
Output for 5.5.8
Foreach took 3.014087677002 microseconds<br />
Output for 5.5.7
Foreach took 2.9668807983398 microseconds<br />
Output for 5.5.6
Foreach took 2.9997825622559 microseconds<br />
Output for 5.5.5
Foreach took 2.9928684234619 microseconds<br />
Output for 5.5.4
Foreach took 2.9480457305908 microseconds<br />
Output for 5.5.3
Foreach took 5.2521228790283 microseconds<br />
Output for 5.5.2
Foreach took 3.1437873840332 microseconds<br />
Output for 5.5.1
Foreach took 3.4761428833008 microseconds<br />
Output for 5.5.0
Foreach took 2.9811859130859 microseconds<br />
Output for 5.4.45
Foreach took 3.7310123443604 microseconds<br />
Output for 5.4.44
Foreach took 3.3829212188721 microseconds<br />
Output for 5.4.43
Foreach took 3.2711029052734 microseconds<br />
Output for 5.4.42
Foreach took 2.9489994049072 microseconds<br />
Output for 5.4.41
Foreach took 3.0620098114014 microseconds<br />
Output for 5.4.30, 5.4.40
Foreach took 2.938985824585 microseconds<br />
Output for 5.4.39
Foreach took 2.9959678649902 microseconds<br />
Output for 5.4.38
Foreach took 3.3888816833496 microseconds<br />
Output for 5.4.37
Foreach took 3.1399726867676 microseconds<br />
Output for 5.4.36
Foreach took 3.2951831817627 microseconds<br />
Output for 5.4.35
Foreach took 3.3810138702393 microseconds<br />
Output for 5.4.34
Foreach took 3.8609504699707 microseconds<br />
Output for 5.4.33
Foreach took 3.8387775421143 microseconds<br />
Output for 5.4.32
Foreach took 3.2551288604736 microseconds<br />
Output for 5.4.31
Foreach took 3.3159255981445 microseconds<br />
Output for 5.4.29
Foreach took 3.4589767456055 microseconds<br />
Output for 5.4.28
Foreach took 3.0109882354736 microseconds<br />
Output for 5.4.27
Foreach took 3.1020641326904 microseconds<br />
Output for 5.4.26
Foreach took 3.4410953521729 microseconds<br />
Output for 5.4.25
Foreach took 2.9289722442627 microseconds<br />
Output for 5.4.24
Foreach took 3.180980682373 microseconds<br />
Output for 5.4.23
Foreach took 4.7378540039062 microseconds<br />
Output for 5.4.22
Foreach took 3.1030178070068 microseconds<br />
Output for 5.4.21
Foreach took 3.0078887939453 microseconds<br />
Output for 5.4.20
Foreach took 3.0908584594727 microseconds<br />
Output for 5.4.19
Foreach took 3.7438869476318 microseconds<br />
Output for 5.4.18
Foreach took 3.1299591064453 microseconds<br />
Output for 5.4.17
Foreach took 2.9749870300293 microseconds<br />
Output for 5.4.16
Foreach took 3.1888484954834 microseconds<br />
Output for 5.4.15
Foreach took 3.47900390625 microseconds<br />
Output for 5.4.14
Foreach took 3.1571388244629 microseconds<br />
Output for 5.4.13
Foreach took 2.9771327972412 microseconds<br />
Output for 5.4.12
Foreach took 3.3590793609619 microseconds<br />
Output for 5.4.11
Foreach took 3.1168460845947 microseconds<br />
Output for 5.4.10
Foreach took 3.2780170440674 microseconds<br />
Output for 5.4.9
Foreach took 3.41796875 microseconds<br />
Output for 5.4.8
Foreach took 2.9609203338623 microseconds<br />
Output for 5.4.7
Foreach took 3.5719871520996 microseconds<br />
Output for 5.4.6
Foreach took 3.1769275665283 microseconds<br />
Output for 5.4.5
Foreach took 3.0839443206787 microseconds<br />
Output for 5.4.4
Foreach took 3.9119720458984 microseconds<br />
Output for 5.4.3
Foreach took 3.0579566955566 microseconds<br />
Output for 5.4.2
Foreach took 3.3931732177734 microseconds<br />
Output for 5.4.1
Foreach took 3.4971237182617 microseconds<br />
Output for 5.4.0
Foreach took 4.8530101776123 microseconds<br />
Output for 5.3.29
Foreach took 2.9871463775635 microseconds<br />
Output for 5.3.28
Foreach took 4.8391819000244 microseconds<br />
Output for 5.3.27
Foreach took 3.2641887664795 microseconds<br />
Output for 5.3.26
Foreach took 3.2989978790283 microseconds<br />
Output for 5.3.25
Foreach took 3.9951801300049 microseconds<br />
Output for 5.3.24
Foreach took 3.3130645751953 microseconds<br />
Output for 5.3.20, 5.3.23
Foreach took 3.5951137542725 microseconds<br />
Output for 5.3.22
Foreach took 3.0760765075684 microseconds<br />
Output for 5.3.21
Foreach took 3.2451152801514 microseconds<br />
Output for 5.3.19
Foreach took 3.0951499938965 microseconds<br />
Output for 5.3.18
Foreach took 3.432035446167 microseconds<br />
Output for 5.3.17
Foreach took 3.108024597168 microseconds<br />
Output for 5.3.16
Foreach took 3.1092166900635 microseconds<br />
Output for 5.3.15
Foreach took 3.7851333618164 microseconds<br />
Output for 5.3.14
Foreach took 3.1061172485352 microseconds<br />
Output for 5.3.13
Foreach took 3.4592151641846 microseconds<br />
Output for 5.3.12
Foreach took 5.012035369873 microseconds<br />
Output for 5.3.11
Foreach took 3.5340785980225 microseconds<br />
Output for 5.3.10
Foreach took 3.2370090484619 microseconds<br />
Output for 5.3.9
Foreach took 3.7930011749268 microseconds<br />
Output for 5.3.8
Foreach took 3.169059753418 microseconds<br />
Output for 5.3.7
Foreach took 3.7171840667725 microseconds<br />
Output for 5.3.6
Foreach took 3.1471252441406 microseconds<br />
Output for 5.3.5
Foreach took 3.2532215118408 microseconds<br />
Output for 5.3.4
Foreach took 3.9680004119873 microseconds<br />
Output for 5.3.3
Foreach took 3.3700466156006 microseconds<br />
Output for 5.3.2
Foreach took 3.3390522003174 microseconds<br />
Output for 5.3.1
Foreach took 4.2791366577148 microseconds<br />
Output for 5.3.0
Foreach took 3.6110877990723 microseconds<br />
Output for 5.2.17
Foreach took 2.1920204162598 microseconds<br />
Output for 5.2.16
Foreach took 2.5649070739746 microseconds<br />
Output for 5.2.15
Foreach took 2.2168159484863 microseconds<br />
Output for 5.2.14
Foreach took 2.6440620422363 microseconds<br />
Output for 5.2.13
Foreach took 2.345085144043 microseconds<br />
Output for 5.2.12
Foreach took 2.2029876708984 microseconds<br />
Output for 5.2.11
Foreach took 1.6829967498779 microseconds<br />
Output for 5.2.10
Foreach took 2.2211074829102 microseconds<br />
Output for 5.2.9
Foreach took 2.0420551300049 microseconds<br />
Output for 5.2.8
Foreach took 2.241849899292 microseconds<br />
Output for 5.2.7
Foreach took 2.4919509887695 microseconds<br />
Output for 5.2.6
Foreach took 2.0439624786377 microseconds<br />
Output for 5.2.5
Foreach took 3.2708644866943 microseconds<br />
Output for 5.2.4
Foreach took 2.4209022521973 microseconds<br />
Output for 5.2.3
Foreach took 2.7611255645752 microseconds<br />
Output for 5.2.2
Foreach took 2.5911331176758 microseconds<br />
Output for 5.2.1
Foreach took 1.9481182098389 microseconds<br />
Output for 5.2.0
Foreach took 1.9340515136719 microseconds<br />
Output for 5.1.6
Foreach took 2.3939609527588 microseconds<br />
Output for 5.1.5
Foreach took 2.3829936981201 microseconds<br />
Output for 5.1.4
Foreach took 2.1240711212158 microseconds<br />
Output for 5.1.3
Foreach took 2.4499893188477 microseconds<br />
Output for 5.1.2
Foreach took 4.1649341583252 microseconds<br />
Output for 5.1.1
Foreach took 2.4020671844482 microseconds<br />
Output for 5.1.0
Foreach took 2.2609233856201 microseconds<br />
Output for 5.0.5
Foreach took 4.6179294586182 microseconds<br />
Output for 5.0.4
Foreach took 4.5721530914307 microseconds<br />
Output for 5.0.3
Foreach took 5.1748752593994 microseconds<br />
Output for 5.0.2
Foreach took 5.2318572998047 microseconds<br />
Output for 5.0.1
Foreach took 6.1488151550293 microseconds<br />
Output for 5.0.0
Foreach took 4.4679641723633 microseconds<br />
Output for 4.4.9
Foreach took 4.267 microseconds<br />
Output for 4.4.8
Foreach took 6.703 microseconds<br />
Output for 4.4.7
Foreach took 5.541 microseconds<br />
Output for 4.4.6
Foreach took 10.004 microseconds<br />
Output for 4.4.5
Foreach took 4.75 microseconds<br />
Output for 4.4.4
Foreach took 6.416 microseconds<br />
Output for 4.4.3
Foreach took 5.55 microseconds<br />
Output for 4.4.2
Foreach took 6.62 microseconds<br />
Output for 4.4.1
Foreach took 4.863 microseconds<br />
Output for 4.4.0
Foreach took 5.558 microseconds<br />
Output for 4.3.11
Foreach took 6.927 microseconds<br />
Output for 4.3.10
Foreach took 5.049 microseconds<br />
Output for 4.3.9
Foreach took 5.858 microseconds<br />
Output for 4.3.8
Foreach took 5.074 microseconds<br />
Output for 4.3.7
Foreach took 8.438 microseconds<br />
Output for 4.3.6
Foreach took 4.833 microseconds<br />
Output for 4.3.5
Foreach took 5.249 microseconds<br />
Output for 4.3.4
Foreach took 5.817 microseconds<br />
Output for 4.3.3
Foreach took 6.782 microseconds<br />
Output for 4.3.2
Foreach took 5.054 microseconds<br />
Output for 4.3.1
Foreach took 5.498 microseconds<br />
Output for 4.3.0
Foreach took 9.983 microseconds<br />

preferences:
273.9 ms | 401 KiB | 322 Q