3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Foreach - inline $results = []; $aHash = []; $i = 0; $tmp = ''; while ($i < 10000) { $tmp .= 'a'; ++$i; } $aHash = array_fill(100000000000000000000000, 100, $tmp); unset($i, $tmp); /* The Test */ $t = microtime(true); foreach ($aHash as $key => $val) $aHash[$key] .= "a"; echo (microtime(true) - $t) * 1000000;
Output for 7.4.0
Warning: array_fill() expects parameter 1 to be int, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 13.113021850586
Output for 7.3.6 - 7.3.7, 7.3.12
Warning: array_fill() expects parameter 1 to be int, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 5.0067901611328
Output for 7.3.11
Warning: array_fill() expects parameter 1 to be int, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 4.7683715820312
Output for 7.3.2, 7.3.5, 7.3.8, 7.3.10
Warning: array_fill() expects parameter 1 to be int, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 4.0531158447266
Output for 7.3.9
Warning: array_fill() expects parameter 1 to be int, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 3.0994415283203
Output for 7.3.4
Warning: array_fill() expects parameter 1 to be int, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 3.814697265625
Output for 7.3.3
Warning: array_fill() expects parameter 1 to be int, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 11.920928955078
Output for 7.3.1
Warning: array_fill() expects parameter 1 to be int, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 9.0599060058594
Output for 7.3.0
Warning: array_fill() expects parameter 1 to be int, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 8.1062316894531
Output for 7.2.0, 7.2.19, 7.2.25
Warning: array_fill() expects parameter 1 to be integer, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 13.113021850586
Output for 7.2.24
Warning: array_fill() expects parameter 1 to be integer, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 20.027160644531
Output for 7.2.23
Warning: array_fill() expects parameter 1 to be integer, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 8.1062316894531
Output for 7.2.22
Warning: array_fill() expects parameter 1 to be integer, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 11.205673217773
Output for 7.2.21
Warning: array_fill() expects parameter 1 to be integer, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 8.8214874267578
Output for 7.1.0 - 7.1.5, 7.2.17, 7.2.20
Warning: array_fill() expects parameter 1 to be integer, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 5.0067901611328
Output for 7.2.18
Warning: array_fill() expects parameter 1 to be integer, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 11.920928955078
Output for 7.0.14, 7.1.31, 7.1.33
Warning: array_fill() expects parameter 1 to be integer, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 3.814697265625
Output for 7.0.0, 7.0.5, 7.1.26, 7.1.30, 7.1.32
Warning: array_fill() expects parameter 1 to be integer, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 4.0531158447266
Output for 7.1.6, 7.1.29
Warning: array_fill() expects parameter 1 to be integer, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 5.9604644775391
Output for 7.1.28
Warning: array_fill() expects parameter 1 to be integer, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 9.0599060058594
Output for 7.1.27
Warning: array_fill() expects parameter 1 to be integer, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 6.9141387939453
Output for 7.1.7
Warning: array_fill() expects parameter 1 to be integer, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 1.9073486328125
Output for 7.0.3 - 7.0.4, 7.0.20
Warning: array_fill() expects parameter 1 to be integer, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 2.8610229492188
Output for 7.0.1 - 7.0.2, 7.0.6
Warning: array_fill() expects parameter 1 to be integer, float given in /in/2MGND on line 13 Warning: Invalid argument supplied for foreach() in /in/2MGND on line 18 3.0994415283203
Output for 5.6.28
411.03363037109
Output for 5.6.21
332.11708068848
Output for 5.6.20
494.95697021484
Output for 5.6.19
336.1701965332
Output for 5.6.18
442.9817199707
Output for 5.6.17
473.0224609375
Output for 5.6.16
504.97055053711
Output for 5.6.15
488.9965057373
Output for 5.6.14
349.04479980469
Output for 5.6.13
441.07437133789
Output for 5.6.12
351.90582275391
Output for 5.4.0, 5.5.31, 5.6.11
432.01446533203
Output for 5.6.10
545.02487182617
Output for 5.6.9
488.0428314209
Output for 5.6.8
528.09715270996
Output for 5.5.35
447.03483581543
Output for 5.5.27, 5.5.34
442.0280456543
Output for 5.5.33
510.93101501465
Output for 5.5.32
393.86749267578
Output for 5.5.30
443.93539428711
Output for 5.5.29
538.11073303223
Output for 5.5.28
501.15585327148
Output for 5.5.26
468.96934509277
Output for 5.5.25
346.89903259277
Output for 5.5.24
527.14347839355
Output for 5.4.45
652.07481384277
Output for 5.4.44
622.98774719238
Output for 5.4.43
698.08959960938
Output for 5.4.42
599.14588928223
Output for 5.4.41
1508.9511871338
Output for 5.4.40
1087.9039764404
Output for 5.4.39
1027.1072387695
Output for 5.4.38
1044.0349578857
Output for 5.4.37
596.04644775391
Output for 5.4.36
664.94941711426
Output for 5.4.35
674.00932312012
Output for 5.4.34
617.02728271484
Output for 5.4.32
270.84350585938
Output for 5.4.31
308.03680419922
Output for 5.4.30
294.92378234863
Output for 5.4.29
273.9429473877
Output for 5.4.28
415.08674621582
Output for 5.4.27
468.01567077637
Output for 5.4.26
497.10273742676
Output for 5.4.25
509.02366638184
Output for 5.4.24
471.11511230469
Output for 5.4.23
545.97854614258
Output for 5.4.22
508.06999206543
Output for 5.4.21
483.03604125977
Output for 5.4.20
469.92301940918
Output for 5.4.19
416.99409484863
Output for 5.4.18
724.07722473145
Output for 5.4.17
548.12431335449
Output for 5.4.16
496.86431884766
Output for 5.4.15
474.92980957031
Output for 5.4.14
452.04162597656
Output for 5.4.13
509.97734069824
Output for 5.4.12
9552.9556274414
Output for 5.4.11
477.07557678223
Output for 5.4.10
458.0020904541
Output for 5.4.9
479.93659973145
Output for 5.4.8
593.90068054199
Output for 5.4.7
569.82040405273
Output for 5.4.6
506.87789916992
Output for 5.4.5
513.07678222656
Output for 5.4.4
1013.9942169189
Output for 5.4.3
896.93069458008
Output for 5.4.2
335.9317779541
Output for 5.4.1
10535.001754761
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/2MGND on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/2MGND on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/2MGND on line 3
Process exited with code 255.

preferences:
134.03 ms | 401 KiB | 205 Q