3v4l.org

run code in 300+ PHP versions simultaneously
<?php $iter = 1000; $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.0100.18415.24
7.3.120.0030.22015.22
7.3.110.0100.27614.88
7.3.100.0030.16014.76
7.3.90.0030.20215.28
7.3.80.0030.16914.65
7.3.70.0000.17114.96
7.3.60.0000.18615.08
7.3.50.0100.14814.82
7.3.40.0130.16914.88
7.3.30.0030.17114.79
7.3.20.0070.16316.42
7.3.10.0070.17316.67
7.3.00.0120.16516.71
7.2.250.0100.30415.40
7.2.240.0130.28815.16
7.2.230.0130.18714.75
7.2.220.0070.20715.36
7.2.210.0070.16315.16
7.2.200.0070.16815.10
7.2.190.0030.16715.00
7.2.180.0030.16815.05
7.2.170.0100.19315.35
7.2.130.0070.18216.76
7.2.120.0070.17116.76
7.2.110.0100.18216.81
7.2.100.0070.20116.83
7.2.90.0030.18316.77
7.2.80.0000.20517.08
7.2.70.0130.16816.92
7.2.60.0030.16816.84
7.2.50.0030.17317.06
7.2.40.0100.20617.03
7.2.30.0100.18216.92
7.2.20.0100.19716.80
7.2.10.0000.17016.84
7.2.00.0050.16618.09
7.1.330.0030.23915.48
7.1.320.0030.28015.78
7.1.310.0030.20916.00
7.1.300.0070.20915.81
7.1.290.0030.20715.76
7.1.280.0030.23015.69
7.1.270.0030.22115.66
7.1.260.0030.21215.57
7.1.250.0000.22115.84
7.1.70.0000.17117.01
7.1.60.0070.17519.17
7.1.50.0100.19616.80
7.1.00.0000.16722.30
7.0.200.0000.15416.76
7.0.140.0000.24021.97
7.0.100.0200.21020.00
7.0.90.0070.16720.08
7.0.80.0300.18320.01
7.0.70.0170.14020.00
7.0.60.0470.27720.05
7.0.50.0400.26020.48
7.0.40.0030.23720.10
7.0.30.0100.24720.10
7.0.20.0070.25320.07
7.0.10.0070.24320.05
7.0.00.0170.24020.03
5.6.280.0070.65321.57
5.6.250.0000.64721.10
5.6.240.0030.54021.24
5.6.230.0000.66021.14
5.6.220.0000.50021.20
5.6.210.0130.60321.04
5.6.200.0030.66021.60
5.6.190.0030.69321.56
5.6.180.0100.68021.58
5.6.170.0100.63721.56
5.6.160.0100.64321.53
5.6.150.0130.64721.63
5.6.140.0170.63021.50
5.6.130.0030.64721.64
5.6.120.0230.62021.65
5.6.110.0030.62021.64
5.6.100.0100.63021.56
5.6.90.0200.65021.41
5.6.80.0030.67021.02
5.6.70.0030.67021.09
5.6.60.0030.61020.92
5.6.50.0100.61021.04
5.6.40.0000.65321.01
5.6.30.0070.63720.91
5.6.20.0130.62020.88
5.6.10.0000.63720.91
5.6.00.0130.62320.98
5.5.380.0070.47020.89
5.5.370.0030.52321.09
5.5.360.0000.55020.90
5.5.350.0030.59020.89
5.5.340.0030.60021.35
5.5.330.0130.71021.45
5.5.320.0070.63321.18
5.5.310.0130.65321.30
5.5.300.0030.61021.41
5.5.290.0000.62021.32
5.5.280.0100.59321.41
5.5.270.0000.64021.46
5.5.260.0030.62321.40
5.5.250.0070.62021.22
5.5.240.0070.61720.66
5.5.230.0170.61720.80
5.5.220.0100.66320.80
5.5.210.0030.59720.70
5.5.200.0100.57320.77
5.5.190.0100.62320.78
5.5.180.0070.57020.66
5.5.160.0070.66720.82
5.5.150.0130.59720.68
5.5.140.0100.63020.66
5.5.130.0070.62020.77
5.5.120.0030.53320.77
5.5.110.0000.56020.81
5.5.100.0070.61720.71
5.5.90.0000.54720.64
5.5.80.0000.57320.61
5.5.70.0030.60020.68
5.5.60.0070.63020.70
5.5.50.0130.61320.64
5.5.40.0130.64020.58
5.5.30.0170.68320.68
5.5.20.0070.63720.60
5.5.10.0000.63320.62
5.5.00.0100.64320.51
5.4.450.0070.63019.83
5.4.440.0030.62019.83
5.4.430.0070.67019.89
5.4.420.0000.61019.91
5.4.410.0070.67019.88
5.4.400.0030.62319.44
5.4.390.0100.71319.53
5.4.380.0070.61019.58
5.4.370.0070.65319.38
5.4.360.0070.62719.53
5.4.350.0100.61719.53
5.4.340.0030.64019.59
5.4.320.0130.62719.51
5.4.310.0070.62319.66
5.4.300.0100.66319.51
5.4.290.0000.64319.48
5.4.280.0030.55719.63
5.4.270.0130.56019.58
5.4.260.0070.55719.45
5.4.250.0030.66319.54
5.4.240.0100.56019.52
5.4.230.0070.63719.54
5.4.220.0030.59019.42
5.4.210.0030.62719.53
5.4.200.0030.65719.36
5.4.190.0130.63719.56
5.4.180.0030.61319.49
5.4.170.0100.62019.57
5.4.160.0100.66019.50
5.4.150.0070.62319.63
5.4.140.0100.63716.72
5.4.130.0070.63716.76
5.4.120.0030.63016.94
5.4.110.0070.65016.92
5.4.100.0100.66016.85
5.4.90.0030.67016.80
5.4.80.0070.68016.98
5.4.70.0030.61316.91
5.4.60.0030.63316.78
5.4.50.0100.60016.79
5.4.40.0030.63716.83
5.4.30.0070.62317.00
5.4.20.0100.75716.79
5.4.10.0070.62716.83
5.4.00.0030.64016.27
5.3.290.0000.62315.12
5.3.280.0100.60015.05
5.3.270.0070.58315.19
5.3.260.0100.59015.12
5.3.250.0070.61015.20
5.3.240.0130.59015.25
5.3.230.0030.61015.23
5.3.220.0030.64715.10
5.3.210.0030.62315.18
5.3.200.0000.61715.20
5.3.190.0070.61315.09
5.3.180.0030.58015.07
5.3.170.0030.63715.15
5.3.160.0100.61315.11
5.3.150.0030.60315.18
5.3.140.0000.60015.17
5.3.130.0030.59715.21
5.3.120.0100.61715.05
5.3.110.0100.62015.13
5.3.100.0070.58714.68
5.3.90.0030.57014.48
5.3.80.0070.62314.50
5.3.70.0100.59714.66
5.3.60.0130.59314.63
5.3.50.0030.60714.44
5.3.40.0130.60014.57
5.3.30.0100.58314.55
5.3.20.0100.59014.18
5.3.10.0100.64014.18
5.3.00.0030.60714.23
5.2.170.0130.05313.83
5.2.160.0030.06013.83
5.2.150.0100.05713.83
5.2.140.0070.05713.83
5.2.130.0030.06013.83
5.2.120.0070.05713.83
5.2.110.0030.05313.83
5.2.100.0000.06313.83
5.2.90.0070.07013.83
5.2.80.0030.04713.83
5.2.70.0030.02713.83
5.2.60.0030.04313.83
5.2.50.0100.04013.83
5.2.40.0070.06013.83
5.2.30.0070.06013.83
5.2.20.0030.06013.83
5.2.10.0070.06013.83
5.2.00.0030.05013.83
5.1.60.0000.05713.83
5.1.50.0030.04013.83
5.1.40.0000.03013.83
5.1.30.0070.05313.83
5.1.20.0130.05013.83
5.1.10.0070.04713.83
5.1.00.0030.03313.83
5.0.50.0030.04713.83
5.0.40.0100.03713.83
5.0.30.0070.04313.83
5.0.20.0030.04313.83
5.0.10.0100.03713.83
5.0.00.0000.06713.83
4.4.90.0000.03013.83
4.4.80.0000.03713.83
4.4.70.0000.03713.83
4.4.60.0000.03713.83
4.4.50.0030.03713.83
4.4.40.0030.05313.83
4.4.30.0100.03013.83
4.4.20.0000.03013.83
4.4.10.0030.03313.83
4.4.00.0070.05313.83
4.3.110.0030.03313.83
4.3.100.0030.03313.83
4.3.90.0130.02713.83
4.3.80.0070.05013.83
4.3.70.0000.03713.83
4.3.60.0030.03713.83
4.3.50.0030.03013.83
4.3.40.0000.05713.83
4.3.30.0000.03713.83
4.3.20.0030.03713.83
4.3.10.0000.03013.83
4.3.00.0000.02013.83

preferences:
34.45 ms | 401 KiB | 5 Q