3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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); }
based on ohVb1
Output for 7.3.1
map_closure runs in 0.0045080184936523s
Output for 7.3.0
map_closure runs in 0.029944896697998s
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.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
Output for 5.4.45
map_closure runs in 0.02515697479248s
Output for 5.4.44
map_closure runs in 0.044344902038574s
Output for 5.4.43
map_closure runs in 0.029441833496094s
Output for 5.4.42
map_closure runs in 0.029067993164062s
Output for 5.4.41
map_closure runs in 0.039772987365723s
Output for 5.4.40
map_closure runs in 0.023870944976807s
Output for 5.4.39
map_closure runs in 0.023093938827515s
Output for 5.4.38
map_closure runs in 0.030471086502075s
Output for 5.4.37
map_closure runs in 0.06315016746521s
Output for 5.4.36
map_closure runs in 0.023965120315552s
Output for 5.4.35
map_closure runs in 0.050325155258179s
Output for 5.4.34
map_closure runs in 0.042055130004883s
Output for 5.4.32
map_closure runs in 0.025107145309448s
Output for 5.4.31
map_closure runs in 0.051836967468262s
Output for 5.4.30
map_closure runs in 0.024925947189331s
Output for 5.4.29
map_closure runs in 0.060873985290527s
Output for 5.4.28
map_closure runs in 0.036067962646484s
Output for 5.4.27
map_closure runs in 0.024019956588745s
Output for 5.4.26
map_closure runs in 0.025099039077759s
Output for 5.4.25
map_closure runs in 0.051408052444458s
Output for 5.4.24
map_closure runs in 0.024265050888062s
Output for 5.4.23
map_closure runs in 0.049465179443359s
Output for 5.4.22
map_closure runs in 0.055305957794189s
Output for 5.4.21
map_closure runs in 0.055233001708984s
Output for 5.4.20
map_closure runs in 0.098675012588501s
Output for 5.4.19
map_closure runs in 0.047677040100098s
Output for 5.4.18
map_closure runs in 0.046885967254639s
Output for 5.4.17
map_closure runs in 0.05333399772644s
Output for 5.4.16
map_closure runs in 0.071684122085571s
Output for 5.4.15
map_closure runs in 0.024027109146118s
Output for 5.4.14
map_closure runs in 0.046415090560913s
Output for 5.4.13
map_closure runs in 0.024949073791504s
Output for 5.4.12
map_closure runs in 0.036669015884399s
Output for 5.3.22 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/5e0b0 on line 4
Process exited with code 255.