3v4l.org

run code in 300+ PHP versions simultaneously
<?php function compose(/* funs to compose */) { $fl = func_get_args(); return function($x) use($fl) { $val = $x; while (null !== $f = array_pop($fl)) { $val = $f($val); }; return $val; }; } $up = function($s) {return strtoupper($s);}; $y = function($s) {return $s.'!';}; $reverse = function($a) {return array_reverse($a);}; $head = function($a) {return array_shift(array_values($a))}; $data = ['jumpkick', 'roundhouse', 'uppercut']; $c = compose($y, $up, $head, $reverse); var_dump($c($data));

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.6.150.0130.03018.19
5.6.140.0130.04318.21
5.6.130.0000.08318.16
5.6.120.0070.06721.14
5.6.110.0130.08721.12
5.6.100.0030.08721.04
5.6.90.0070.04020.96
5.6.80.0200.07020.50
5.5.300.0030.04018.07
5.5.290.0100.07717.96
5.5.280.0130.05020.88
5.5.270.0130.08020.88
5.5.260.0100.07020.77
5.5.250.0030.09320.81
5.5.240.0200.07020.08

preferences:
143.32 ms | 1394 KiB | 7 Q