3v4l.org

run code in 300+ PHP versions simultaneously
<?php $iter = 100; $array = range(0, $iter); $function = function($val, $key) {}; $t = microtime(true); for($i = 0; $i < $iter; $i++) { foreach($array as $key => $val) { $function($val, $key); } } echo 'foreach: '.(microtime(true) - $t).'\n'; $t = microtime(true); for($i = 0; $i < $iter; $i++) { array_walk($array, $function); } echo 'array_walk: '.(microtime(true) - $t).'\n'; $t = microtime(true); for($i = 0; $i < $iter; $i++) { array_map($function, $array, array_keys($array)); } echo 'array_map: '.(microtime(true) - $t).'\n';

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.0070.01114.80
7.3.120.0070.01714.80
7.3.110.0090.01315.11
7.3.100.0070.01414.68
7.3.90.0130.00314.70
7.3.80.0110.00414.75
7.3.70.0030.01014.69
7.3.60.0070.01014.86
7.3.50.0000.01114.71
7.3.40.0000.01714.89
7.3.30.0060.01214.90
7.3.20.0070.01016.44
7.3.10.0030.01016.75
7.3.00.0070.00816.53
7.2.250.0100.01314.93
7.2.240.0070.01614.95
7.2.230.0040.01414.67
7.2.220.0100.01315.06
7.2.210.0110.00714.80
7.2.200.0030.01415.13
7.2.190.0080.00815.05
7.2.180.0100.01015.06
7.2.170.0000.02015.21
7.2.130.0030.01316.94
7.2.120.0070.00717.04
7.2.110.0100.01016.98
7.2.100.0060.01316.95
7.2.90.0090.00617.02
7.2.80.0070.01017.09
7.2.70.0120.00617.01
7.2.60.0130.00317.05
7.2.50.0070.01016.86
7.2.40.0140.00317.02
7.2.30.0090.00917.05
7.2.20.0030.01417.07
7.2.10.0030.01616.83
7.2.00.0050.01118.33
7.1.330.0070.01115.51
7.1.320.0040.01115.63
7.1.310.0040.00715.94
7.1.300.0070.00715.44
7.1.290.0030.01415.82
7.1.280.0060.01215.84
7.1.270.0140.00315.89
7.1.260.0070.01015.57
7.1.250.0040.01815.76
7.1.70.0100.00517.09
7.1.60.0070.01319.17
7.1.50.0110.01816.64
7.1.00.0030.08022.54
7.0.200.0180.00415.04
7.0.140.0070.07321.92
7.0.100.0170.07020.01
7.0.90.0030.05019.84
7.0.80.0300.06319.95
7.0.70.0230.08320.01
7.0.60.0200.08720.00
7.0.50.0100.08320.40
7.0.40.0100.08020.05
7.0.30.0100.06319.99
7.0.20.0100.06020.04
7.0.10.0130.08020.04
7.0.00.0170.08020.04
5.6.280.0030.08320.93
5.6.250.0030.09320.66
5.6.240.0100.05720.63
5.6.230.0170.07320.66
5.6.220.0170.07720.60
5.6.210.0100.07720.61
5.6.200.0170.08021.17
5.6.190.0130.08321.04
5.6.180.0100.07321.14
5.6.170.0100.07020.97
5.6.160.0070.08721.08
5.6.150.0130.06721.07
5.6.140.0170.10321.12
5.6.130.0170.07321.16
5.6.120.0130.09021.04
5.6.110.0030.09021.03
5.6.100.0100.08021.13
5.6.90.0130.09320.96
5.6.80.0130.07020.59
5.6.70.0130.08320.45
5.6.60.0070.09020.42
5.6.50.0100.05320.46
5.6.40.0030.08320.49
5.6.30.0070.08720.41
5.6.20.0100.09020.52
5.6.10.0100.07720.55
5.6.00.0100.08020.39
5.5.380.0130.08020.46
5.5.370.0100.08020.40
5.5.360.0100.07720.45
5.5.350.0100.08320.44
5.5.340.0200.06720.92
5.5.330.0100.10020.90
5.5.320.0030.09720.79
5.5.310.0030.05320.94
5.5.300.0070.09720.95
5.5.290.0070.09720.79
5.5.280.0100.07020.83
5.5.270.0100.08320.85
5.5.260.0100.06720.91
5.5.250.0100.08020.70
5.5.240.0130.08320.29
5.5.230.0070.09720.21
5.5.220.0170.08020.34
5.5.210.0170.06020.29
5.5.200.0030.06720.16
5.5.190.0170.07320.14
5.5.180.0130.08020.29
5.5.160.0170.07720.18
5.5.150.0070.09020.31
5.5.140.0000.07320.11
5.5.130.0130.06720.29
5.5.120.0100.08020.28
5.5.110.0100.08720.29
5.5.100.0170.08720.10
5.5.90.0070.08719.96
5.5.80.0030.08320.20
5.5.70.0100.08720.11
5.5.60.0030.09020.03
5.5.50.0030.08320.14
5.5.40.0070.08320.18
5.5.30.0170.07320.08
5.5.20.0100.07320.02
5.5.10.0100.07720.10
5.5.00.0100.05020.08
5.4.450.0100.08719.38
5.4.440.0100.08019.37
5.4.430.0030.09719.20
5.4.420.0100.08019.53
5.4.410.0100.08719.40
5.4.400.0100.09019.03
5.4.390.0000.09018.90
5.4.380.0070.05718.88
5.4.370.0000.09018.95
5.4.360.0130.08019.03
5.4.350.0170.04019.12
5.4.340.0030.09019.21
5.4.320.0130.08319.09
5.4.310.0100.08019.20
5.4.300.0100.07019.13
5.4.290.0100.07719.16
5.4.280.0030.08018.90
5.4.270.0070.04719.20
5.4.260.0070.05019.04
5.4.250.0070.07719.20
5.4.240.0100.08319.11
5.4.230.0100.08018.84
5.4.220.0170.08319.12
5.4.210.0000.08019.02
5.4.200.0070.07719.16
5.4.190.0030.08318.88
5.4.180.0100.08019.19
5.4.170.0070.07719.20
5.4.160.0000.09019.02
5.4.150.0030.09019.11
5.4.140.0100.09016.19
5.4.130.0030.06316.41
5.4.120.0000.05716.38
5.4.110.0100.04316.38
5.4.100.0070.07716.56
5.4.90.0030.08716.55
5.4.80.0030.06316.43
5.4.70.0030.08716.50
5.4.60.0030.05016.36
5.4.50.0070.05016.39
5.4.40.0170.04316.36
5.4.30.0030.04016.51
5.4.20.0030.09016.52
5.4.10.0030.05016.41
5.4.00.0070.04715.88
5.3.290.0130.07314.75
5.3.280.0100.07314.67
5.3.270.0030.08014.72
5.3.260.0030.07714.72
5.3.250.0070.07714.78
5.3.240.0130.07314.64
5.3.230.0030.07014.71
5.3.220.0100.06714.54
5.3.210.0030.08314.68
5.3.200.0030.05314.59
5.3.190.0130.06714.68
5.3.180.0030.08014.59
5.3.170.0130.06714.64
5.3.160.0070.04714.59
5.3.150.0030.05314.62
5.3.140.0100.08014.57
5.3.130.0100.07714.54
5.3.120.0000.07714.61
5.3.110.0100.04714.65
5.3.100.0100.07014.17
5.3.90.0030.09014.15
5.3.80.0100.09014.12
5.3.70.0100.08014.12
5.3.60.0100.08014.10
5.3.50.0070.07014.02
5.3.40.0070.04714.05
5.3.30.0070.08313.98
5.3.20.0100.07013.65
5.3.10.0030.06313.81
5.3.00.0130.06713.61
5.2.170.0030.06712.59
5.2.160.0070.05712.59
5.2.150.0030.06012.59
5.2.140.0000.03712.59
5.2.130.0070.04012.59
5.2.120.0030.06712.59
5.2.110.0000.03712.59
5.2.100.0070.06012.59
5.2.90.0070.04712.59
5.2.80.0130.05012.59
5.2.70.0030.06312.59
5.2.60.0030.05012.59
5.2.50.0070.05712.59
5.2.40.0070.05312.59
5.2.30.0100.05712.59
5.2.20.0070.05312.59
5.2.10.0100.05312.59
5.2.00.0070.04012.59
5.1.60.0000.05012.59
5.1.50.0100.04712.59
5.1.40.0030.05312.59
5.1.30.0030.05712.59
5.1.20.0070.05012.59
5.1.10.0000.05312.59
5.1.00.0070.03712.59
5.0.50.0030.03712.59
5.0.40.0030.02012.59
5.0.30.0070.04012.59
5.0.20.0070.01712.59
5.0.10.0030.03312.59
5.0.00.0030.06712.59
4.4.90.0030.01712.59
4.4.80.0030.02712.59
4.4.70.0030.02712.59
4.4.60.0030.03012.59
4.4.50.0000.03312.59
4.4.40.0070.05012.59
4.4.30.0000.03712.59
4.4.20.0000.02712.59
4.4.10.0030.02312.59
4.4.00.0030.03712.59
4.3.110.0030.03312.59
4.3.100.0070.03012.59
4.3.90.0030.03312.59
4.3.80.0000.05012.59
4.3.70.0030.03312.59
4.3.60.0030.02712.59
4.3.50.0030.03312.59
4.3.40.0070.04712.59
4.3.30.0000.03712.59
4.3.20.0030.02712.59
4.3.10.0000.03712.59
4.3.00.0000.02312.59

preferences:
36.25 ms | 401 KiB | 5 Q