3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = range(0, 1000, 1); $benchmarks = []; $runs = 100; $callback = function ($item) { return $item * 2; }; $benchmarks['map_closure'] = function ($array) use ($callback) { return array_map($callback, $array); }; foreach ($benchmarks as $code => $callable) { $start = microtime(true); $collected = 0; while ($collected < $runs) { $collected++; $callable($array); } $end = microtime(true); printf('%s runs in %ss %s', $code, $end - $start, PHP_EOL); }
Output for 7.4.0
map_closure runs in 0.0059220790863037s
Output for 7.3.12
map_closure runs in 0.0048210620880127s
Output for 7.3.11
map_closure runs in 0.0073080062866211s
Output for 7.3.10
map_closure runs in 0.0038230419158936s
Output for 7.3.9
map_closure runs in 0.006317138671875s
Output for 7.3.8
map_closure runs in 0.0051050186157227s
Output for 7.3.7
map_closure runs in 0.0041391849517822s
Output for 7.3.6
map_closure runs in 0.0039360523223877s
Output for 7.3.5
map_closure runs in 0.0040271282196045s
Output for 7.3.4
map_closure runs in 0.00553297996521s
Output for 7.3.3
map_closure runs in 0.0042309761047363s
Output for 7.3.2
map_closure runs in 0.00541090965271s
Output for 7.3.1
map_closure runs in 0.0040760040283203s
Output for 7.3.0
map_closure runs in 0.0038249492645264s
Output for 7.2.25
map_closure runs in 0.0078451633453369s
Output for 7.2.24
map_closure runs in 0.0083911418914795s
Output for 7.2.23
map_closure runs in 0.0062270164489746s
Output for 7.2.22
map_closure runs in 0.0043141841888428s
Output for 7.2.21
map_closure runs in 0.006505012512207s
Output for 7.2.20
map_closure runs in 0.004295825958252s
Output for 7.2.19
map_closure runs in 0.0043990612030029s
Output for 7.2.18
map_closure runs in 0.0048871040344238s
Output for 7.2.17
map_closure runs in 0.0044407844543457s
Output for 7.2.13
map_closure runs in 0.0044910907745361s
Output for 7.2.12
map_closure runs in 0.0044960975646973s
Output for 7.2.11
map_closure runs in 0.0081140995025635s
Output for 7.2.10
map_closure runs in 0.0053689479827881s
Output for 7.2.9
map_closure runs in 0.0074598789215088s
Output for 7.2.8
map_closure runs in 0.0081250667572021s
Output for 7.2.7
map_closure runs in 0.0061278343200684s
Output for 7.2.6
map_closure runs in 0.01114296913147s
Output for 7.2.5
map_closure runs in 0.0066790580749512s
Output for 7.2.4
map_closure runs in 0.033776998519897s
Output for 7.2.3
map_closure runs in 0.0069210529327393s
Output for 7.2.2
map_closure runs in 0.0071089267730713s
Output for 7.2.1
map_closure runs in 0.0045568943023682s
Output for 7.2.0
map_closure runs in 0.0061109066009521s
Output for 7.1.33
map_closure runs in 0.0055501461029053s
Output for 7.1.32
map_closure runs in 0.0051119327545166s
Output for 7.1.31
map_closure runs in 0.010141134262085s
Output for 7.1.30
map_closure runs in 0.0083560943603516s
Output for 7.1.29
map_closure runs in 0.0069608688354492s
Output for 7.1.28
map_closure runs in 0.0083498954772949s
Output for 7.1.27
map_closure runs in 0.0066330432891846s
Output for 7.1.26
map_closure runs in 0.0066671371459961s
Output for 7.1.25
map_closure runs in 0.0082130432128906s
Output for 7.1.7
map_closure runs in 0.0037240982055664s
Output for 7.1.6
map_closure runs in 0.0050079822540283s
Output for 7.1.5
map_closure runs in 0.0088930130004883s
Output for 7.1.0
map_closure runs in 0.0066161155700684s
Output for 7.0.20
map_closure runs in 0.0093719959259033s
Output for 7.0.6
map_closure runs in 0.0091779232025146s
Output for 7.0.5
map_closure runs in 0.0092089176177979s
Output for 7.0.4
map_closure runs in 0.0087571144104004s
Output for 7.0.3
map_closure runs in 0.0080389976501465s
Output for 7.0.2
map_closure runs in 0.010040998458862s
Output for 7.0.1
map_closure runs in 0.0066418647766113s
Output for 7.0.0
map_closure runs in 0.012618064880371s
Output for 5.6.28
map_closure runs in 0.027539014816284s
Output for 5.6.21
map_closure runs in 0.024930953979492s
Output for 5.6.20
map_closure runs in 0.023853063583374s
Output for 5.6.19
map_closure runs in 0.015558004379272s
Output for 5.6.18
map_closure runs in 0.035382986068726s
Output for 5.6.17
map_closure runs in 0.023483037948608s
Output for 5.6.16
map_closure runs in 0.030746936798096s
Output for 5.6.15
map_closure runs in 0.019320964813232s
Output for 5.6.14
map_closure runs in 0.016548871994019s
Output for 5.6.13
map_closure runs in 0.024864912033081s
Output for 5.6.12
map_closure runs in 0.016857862472534s
Output for 5.6.11
map_closure runs in 0.02391791343689s
Output for 5.6.10
map_closure runs in 0.02390718460083s
Output for 5.6.9
map_closure runs in 0.01631498336792s
Output for 5.6.8
map_closure runs in 0.025875806808472s
Output for 5.5.35
map_closure runs in 0.023710966110229s
Output for 5.5.34
map_closure runs in 0.023941993713379s
Output for 5.5.33
map_closure runs in 0.020364999771118s
Output for 5.5.32
map_closure runs in 0.019591093063354s
Output for 5.5.31
map_closure runs in 0.021203994750977s
Output for 5.5.30
map_closure runs in 0.0209801197052s
Output for 5.5.29
map_closure runs in 0.022113084793091s
Output for 5.5.28
map_closure runs in 0.024959087371826s
Output for 5.5.27
map_closure runs in 0.023697137832642s
Output for 5.5.26
map_closure runs in 0.024088859558105s
Output for 5.5.25
map_closure runs in 0.021293878555298s
Output for 5.5.24
map_closure runs in 0.022452831268311s

preferences:
80.3 ms | 402 KiB | 90 Q