3v4l.org

run code in 300+ PHP versions simultaneously
<?php // For with brackets $results = []; $aHash = []; $i = 0; $tmp = ''; while ($i < 10000) { $tmp .= 'a'; ++$i; } $aHash = array_fill(100000000000000000000000, 100, $tmp); unset($i, $tmp); $t = microtime(true); $key = array_keys($aHash); $size = count($key); for ($i = 0; $i < $size; $i++) { $aHash[$key[$i]] .= "a"; } echo (microtime(true) - $t) * 1000000;
Output for 7.4.0
Warning: array_fill() expects parameter 1 to be int, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 Warning: count(): Parameter must be an array or an object that implements Countable in /in/9j6Up on line 19 17.166137695312
Output for 7.3.12
Warning: array_fill() expects parameter 1 to be int, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 Warning: count(): Parameter must be an array or an object that implements Countable in /in/9j6Up on line 19 9.7751617431641
Output for 7.3.5, 7.3.11
Warning: array_fill() expects parameter 1 to be int, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 Warning: count(): Parameter must be an array or an object that implements Countable in /in/9j6Up on line 19 8.1062316894531
Output for 7.3.1, 7.3.4, 7.3.10
Warning: array_fill() expects parameter 1 to be int, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 Warning: count(): Parameter must be an array or an object that implements Countable in /in/9j6Up on line 19 7.8678131103516
Output for 7.3.9
Warning: array_fill() expects parameter 1 to be int, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 Warning: count(): Parameter must be an array or an object that implements Countable in /in/9j6Up on line 19 12.874603271484
Output for 7.3.8
Warning: array_fill() expects parameter 1 to be int, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 Warning: count(): Parameter must be an array or an object that implements Countable in /in/9j6Up on line 19 14.066696166992
Output for 7.3.6 - 7.3.7
Warning: array_fill() expects parameter 1 to be int, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 Warning: count(): Parameter must be an array or an object that implements Countable in /in/9j6Up on line 19 10.013580322266
Output for 7.3.2 - 7.3.3
Warning: array_fill() expects parameter 1 to be int, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 Warning: count(): Parameter must be an array or an object that implements Countable in /in/9j6Up on line 19 7.1525573730469
Output for 7.3.0
Warning: array_fill() expects parameter 1 to be int, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 Warning: count(): Parameter must be an array or an object that implements Countable in /in/9j6Up on line 19 21.934509277344
Output for 7.2.25
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 Warning: count(): Parameter must be an array or an object that implements Countable in /in/9j6Up on line 19 10.967254638672
Output for 7.2.24
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 Warning: count(): Parameter must be an array or an object that implements Countable in /in/9j6Up on line 19 21.934509277344
Output for 7.2.23
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 Warning: count(): Parameter must be an array or an object that implements Countable in /in/9j6Up on line 19 14.066696166992
Output for 7.2.17 - 7.2.19, 7.2.21 - 7.2.22
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 Warning: count(): Parameter must be an array or an object that implements Countable in /in/9j6Up on line 19 8.1062316894531
Output for 7.2.20
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 Warning: count(): Parameter must be an array or an object that implements Countable in /in/9j6Up on line 19 12.874603271484
Output for 7.2.0
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 Warning: count(): Parameter must be an array or an object that implements Countable in /in/9j6Up on line 19 9.0599060058594
Output for 7.0.6 - 7.0.14, 7.1.28 - 7.1.29, 7.1.33
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 5.9604644775391
Output for 7.1.31 - 7.1.32
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 10.013580322266
Output for 7.1.5, 7.1.27, 7.1.30
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 7.1525573730469
Output for 7.0.2 - 7.0.3, 7.0.5, 7.1.26
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 5.0067901611328
Output for 7.0.1, 7.0.4, 7.1.7
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 3.0994415283203
Output for 7.1.6
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 6.9141387939453
Output for 7.1.0
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 9.0599060058594
Output for 7.0.20
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 10.967254638672
Output for 7.0.0
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9j6Up on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/9j6Up on line 18 4.0531158447266
Output for 5.6.28
416.99409484863
Output for 5.6.21
489.95018005371
Output for 5.6.20
314.95094299316
Output for 5.6.19
452.99530029297
Output for 5.6.18
450.13427734375
Output for 5.6.17
473.0224609375
Output for 5.6.16
478.02925109863
Output for 5.6.15
464.91622924805
Output for 5.6.14
300.88424682617
Output for 5.4.10, 5.6.13
498.05641174316
Output for 5.6.12
536.91864013672
Output for 5.6.11
325.91819763184
Output for 5.6.10
418.90144348145
Output for 5.6.9
502.10952758789
Output for 5.6.8
518.798828125
Output for 5.5.35
366.9261932373
Output for 5.5.34
472.06878662109
Output for 5.5.33
399.11270141602
Output for 5.5.32
438.21334838867
Output for 5.5.31
397.92060852051
Output for 5.5.30
462.05520629883
Output for 5.5.29
483.98971557617
Output for 5.4.42, 5.5.28
304.9373626709
Output for 5.5.27
442.0280456543
Output for 5.5.26
508.06999206543
Output for 5.5.25
311.13624572754
Output for 5.4.4, 5.5.24
488.0428314209
Output for 5.4.45
284.91020202637
Output for 5.4.44
381.9465637207
Output for 5.4.43
326.87187194824
Output for 5.4.41
377.89344787598
Output for 5.4.40
363.11149597168
Output for 5.4.39
359.77363586426
Output for 5.4.38
762.939453125
Output for 5.4.37
880.00297546387
Output for 5.4.36
4139.9002075195
Output for 5.4.35
1034.0213775635
Output for 5.4.34
1446.008682251
Output for 5.4.32
287.05596923828
Output for 5.4.31
285.86387634277
Output for 5.4.30
535.96496582031
Output for 5.4.29
417.94776916504
Output for 5.4.28
437.97492980957
Output for 5.4.27
569.10514831543
Output for 5.4.26
551.93901062012
Output for 5.4.25
471.11511230469
Output for 5.4.24
497.81799316406
Output for 5.4.23
502.8247833252
Output for 5.4.13, 5.4.22
495.91064453125
Output for 5.4.21
1877.0694732666
Output for 5.4.20
539.06440734863
Output for 5.4.19
511.88468933105
Output for 5.4.18
509.02366638184
Output for 5.4.17
334.02442932129
Output for 5.4.16
298.97689819336
Output for 5.4.15
525.95138549805
Output for 5.4.14
432.96813964844
Output for 5.4.12
345.94535827637
Output for 5.4.11
548.12431335449
Output for 5.4.9
510.93101501465
Output for 5.4.8
427.9613494873
Output for 5.4.7
530.95817565918
Output for 5.4.6
565.0520324707
Output for 5.4.5
463.00888061523
Output for 5.4.3
516.89147949219
Output for 5.4.2
432.01446533203
Output for 5.4.1
540.01808166504
Output for 5.4.0
494.95697021484
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/9j6Up 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/9j6Up on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/9j6Up on line 3
Process exited with code 255.

preferences:
173.88 ms | 401 KiB | 205 Q