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); }

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)
7.4.00.0060.01914.97
7.3.120.0080.01214.80
7.3.110.0070.01914.81
7.3.100.0080.01014.99
7.3.90.0030.01615.20
7.3.80.0030.01615.03
7.3.70.0040.01214.85
7.3.60.0080.01214.76
7.3.50.0110.00714.86
7.3.40.0030.01214.82
7.3.30.0030.01314.96
7.3.20.0060.01216.81
7.3.10.0070.01216.63
7.3.00.0110.01116.68
7.2.250.0050.02215.21
7.2.240.0050.02214.79
7.2.230.0050.01415.19
7.2.220.0060.01014.87
7.2.210.0050.01715.14
7.2.200.0100.01015.08
7.2.190.0080.01315.15
7.2.180.0050.01315.05
7.2.170.0080.01215.20
7.2.130.0120.01216.82
7.2.120.0100.01016.77
7.2.110.0060.01816.72
7.2.100.0080.01216.90
7.2.90.0060.01816.62
7.2.80.0090.01716.86
7.2.70.0100.01616.89
7.2.60.0130.01616.74
7.2.50.0040.01816.71
7.2.40.0090.01616.69
7.2.30.0090.01316.54
7.2.20.0040.01816.89
7.2.10.0070.01316.66
7.2.00.0030.01718.13
7.1.330.0030.01816.01
7.1.320.0070.01515.94
7.1.310.0050.01915.76
7.1.300.0080.01315.81
7.1.290.0070.01115.76
7.1.280.0090.00815.67
7.1.270.0070.01015.78
7.1.260.0070.01315.71
7.1.250.0030.01915.64
7.1.70.0000.01117.22
7.1.60.0000.01617.41
7.1.50.0100.02116.93
7.1.00.0000.08722.51
7.0.200.0070.02016.85
7.0.60.0070.08721.84
7.0.50.0100.08718.02
7.0.40.0100.08720.27
7.0.30.0300.08020.06
7.0.20.0430.05320.23
7.0.10.0000.06020.08
7.0.00.0100.07020.10
5.6.280.0030.10321.20
5.6.210.0100.10720.88
5.6.200.0070.10318.44
5.6.190.0030.05720.65
5.6.180.0330.11020.71
5.6.170.0400.10320.68
5.6.160.0070.11720.64
5.6.150.0100.07318.42
5.6.140.0030.06018.39
5.6.130.0170.09718.40
5.6.120.0000.08021.41
5.6.110.0170.09721.38
5.6.100.0270.08321.27
5.6.90.0030.06021.26
5.6.80.0100.10720.71
5.5.350.0130.06720.69
5.5.340.0070.10318.20
5.5.330.0100.10020.46
5.5.320.0630.08320.34
5.5.310.0230.10020.59
5.5.300.0070.10018.27
5.5.290.0330.06018.23
5.5.280.0100.11321.14
5.5.270.0030.11021.06
5.5.260.0030.11321.24
5.5.250.0100.09721.00
5.5.240.0270.09320.57

preferences:
35.79 ms | 401 KiB | 5 Q