3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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.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.6 - 7.0.14
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.0.2 - 7.0.3, 7.0.5
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
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.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.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.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.