3v4l.org

run code in 300+ PHP versions simultaneously
<?php // For inline $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.2.0
Warning: array_fill() expects parameter 1 to be integer, float given in /in/6kfJZ on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/6kfJZ on line 18 Warning: count(): Parameter must be an array or an object that implements Countable in /in/6kfJZ on line 19 5.9604644775391
Output for 7.0.5, 7.0.20, 7.1.7
Warning: array_fill() expects parameter 1 to be integer, float given in /in/6kfJZ on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/6kfJZ on line 18 2.8610229492188
Output for 7.1.6
Warning: array_fill() expects parameter 1 to be integer, float given in /in/6kfJZ on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/6kfJZ on line 18 8.1062316894531
Output for 7.0.3, 7.1.5
Warning: array_fill() expects parameter 1 to be integer, float given in /in/6kfJZ on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/6kfJZ on line 18 4.0531158447266
Output for 7.0.2, 7.0.14, 7.1.0
Warning: array_fill() expects parameter 1 to be integer, float given in /in/6kfJZ on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/6kfJZ on line 18 5.0067901611328
Output for 7.0.6
Warning: array_fill() expects parameter 1 to be integer, float given in /in/6kfJZ on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/6kfJZ on line 18 6.1988830566406
Output for 7.0.4
Warning: array_fill() expects parameter 1 to be integer, float given in /in/6kfJZ on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/6kfJZ on line 18 1.9073486328125
Output for 7.0.1
Warning: array_fill() expects parameter 1 to be integer, float given in /in/6kfJZ on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/6kfJZ on line 18 4.7683715820312
Output for 7.0.0
Warning: array_fill() expects parameter 1 to be integer, float given in /in/6kfJZ on line 13 Warning: array_keys() expects parameter 1 to be array, null given in /in/6kfJZ on line 18 3.0994415283203
Output for 5.6.28
416.04042053223
Output for 5.4.12, 5.6.21
376.93977355957
Output for 5.6.20
509.97734069824
Output for 5.4.28, 5.6.19
509.02366638184
Output for 5.6.18
494.00329589844
Output for 5.5.31, 5.6.17
422.00088500977
Output for 5.6.16
505.92422485352
Output for 5.6.15
471.83036804199
Output for 5.4.4, 5.6.14
519.99092102051
Output for 5.6.13
307.79838562012
Output for 5.6.12
485.89706420898
Output for 5.6.11
553.84635925293
Output for 5.6.10
531.91184997559
Output for 5.6.9
514.03045654297
Output for 5.6.8
349.04479980469
Output for 5.6.7
326.87187194824
Output for 5.5.35
551.93901062012
Output for 5.5.34
549.0779876709
Output for 5.5.33
390.05279541016
Output for 5.5.32
459.90943908691
Output for 5.5.30
434.87548828125
Output for 5.5.29
434.16023254395
Output for 5.4.21, 5.5.28
472.06878662109
Output for 5.5.27
540.01808166504
Output for 5.4.30, 5.5.26
492.09594726562
Output for 5.5.25
544.07119750977
Output for 5.5.24
421.04721069336
Output for 5.4.45
747.9190826416
Output for 5.4.44
696.89750671387
Output for 5.4.43
724.79248046875
Output for 5.4.42
705.00373840332
Output for 5.4.41
720.02410888672
Output for 5.4.40
952.00538635254
Output for 5.4.39
651.12113952637
Output for 5.4.38
688.07601928711
Output for 5.4.37
530.00450134277
Output for 5.4.36
798.94065856934
Output for 5.4.35
316.85829162598
Output for 5.4.34
319.9577331543
Output for 5.4.32
329.97131347656
Output for 5.4.31
301.12266540527
Output for 5.4.29
303.03001403809
Output for 5.4.27
380.9928894043
Output for 5.4.26
611.78207397461
Output for 5.4.25
562.90626525879
Output for 5.4.24
432.96813964844
Output for 5.4.23
405.78842163086
Output for 5.4.22
440.83595275879
Output for 5.4.20
420.80879211426
Output for 5.4.19
455.85632324219
Output for 5.4.18
379.08554077148
Output for 5.4.17
660.89630126953
Output for 5.4.16
396.9669342041
Output for 5.4.15
452.04162597656
Output for 5.4.14
665.18783569336
Output for 5.4.13
410.07995605469
Output for 5.4.11
469.92301940918
Output for 5.4.10
460.14785766602
Output for 5.4.9
437.02125549316
Output for 5.4.8
663.04206848145
Output for 5.4.7
524.04403686523
Output for 5.4.6
453.94897460938
Output for 5.4.5
435.11390686035
Output for 5.4.3
530.95817565918
Output for 5.4.2
446.79641723633
Output for 5.4.1
457.0484161377
Output for 5.4.0
473.97613525391
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/6kfJZ 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/6kfJZ on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/6kfJZ on line 3
Process exited with code 255.

preferences:
135.65 ms | 401 KiB | 175 Q