3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = range(0,100000); $t = microtime(1); array_map(function($v) { $v++; }, $a); $t = microtime(1) - $t; echo "map func: $t\n"; $a = range(0,100000); $t = microtime(1); $func = function($v) { $v++; }; array_map($func, $a); $t = microtime(1) - $t; echo "map var func: $t\n"; $a = range(0,100000); $t = microtime(1); array_walk($a, function($v) { $v++; }); $t = microtime(1) - $t; echo "walk func: $t\n"; $a = range(0,100000); $t = microtime(1); $func = function($v) { $v++; }; array_walk($a, $func); $t = microtime(1) - $t; echo "walk var func: $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.0270.03023.70
7.3.120.0140.06123.20
7.3.110.0160.03923.09
7.3.100.0130.03723.24
7.3.90.0100.05423.03
7.3.80.0170.03022.70
7.3.70.0070.03323.06
7.3.60.0100.03423.13
7.3.50.0230.02322.99
7.3.40.0230.02323.09
7.3.30.0070.03923.16
7.3.20.0130.02926.57
7.3.10.0070.03626.68
7.3.00.0000.03726.68
7.2.250.0200.03423.01
7.2.240.0140.06823.13
7.2.230.0070.04823.02
7.2.220.0200.04923.44
7.2.210.0200.02923.14
7.2.200.0160.03023.33
7.2.190.0160.03223.14
7.2.180.0130.03623.33
7.2.170.0170.03323.07
7.2.00.0030.03329.24
7.1.330.0190.02925.91
7.1.320.0100.03725.85
7.1.310.0070.04425.77
7.1.300.0000.04725.63
7.1.290.0160.03225.80
7.1.280.0070.04325.74
7.1.270.0070.04725.78
7.1.260.0060.03725.76
7.1.70.0100.02327.13
7.1.60.0030.04127.19
7.1.50.0070.06726.86
7.1.00.0030.11332.19
7.0.200.2240.03022.70
7.0.140.0030.11030.18
7.0.60.0130.12325.88
7.0.50.0070.08023.84
7.0.40.0100.07725.77
7.0.30.0570.08725.88
7.0.20.0600.09025.64
7.0.10.0130.06725.84
7.0.00.0130.09725.63
5.6.280.0330.21358.66
5.6.210.0500.19758.36
5.6.200.0370.14755.94
5.6.190.0270.15758.14
5.6.180.0530.17057.98
5.6.170.0430.22058.18
5.6.160.0370.19358.07
5.6.150.0230.22755.85
5.6.140.0230.16055.90
5.6.130.0370.24055.89
5.6.120.0300.16358.88
5.6.110.0470.20758.78
5.6.100.0270.22758.74
5.6.90.0300.17358.86
5.6.80.0370.16058.20
5.5.350.3230.14758.25
5.5.340.0370.19755.71
5.5.330.0200.17057.89
5.5.320.0500.21357.87
5.5.310.0630.18757.79
5.5.300.0230.15755.75
5.5.290.0430.20755.72
5.5.280.0430.16058.64
5.5.270.0470.15358.52
5.5.260.0270.16758.62
5.5.250.0430.22358.34
5.5.240.0270.20758.02
5.4.450.0600.22357.25
5.4.440.0430.20757.32
5.4.430.0400.17757.10
5.4.420.0630.19357.03
5.4.410.0700.22056.88
5.4.400.0370.20356.99
5.4.390.0500.22056.57
5.4.380.1330.27056.48
5.4.370.1300.38056.49
5.4.360.1270.27756.43
5.4.350.1170.26356.36
5.4.340.1470.27056.32
5.4.320.0220.19850.25
5.4.310.0320.17250.25
5.4.300.0280.18950.26
5.4.290.0270.16450.24
5.4.280.0290.18250.16
5.4.270.0250.16950.15
5.4.260.0230.17450.15
5.4.250.0330.17550.15
5.4.240.0240.18150.15
5.4.230.0260.18250.14
5.4.220.0250.17650.14
5.4.210.0350.22950.14
5.4.200.0300.16850.14
5.4.190.0310.16550.14
5.4.180.0240.18150.14
5.4.170.0220.17650.15
5.4.160.0290.17650.14
5.4.150.0290.17450.14
5.4.140.0260.16649.82
5.4.130.0180.18049.81
5.4.120.0330.20749.77
5.4.110.0260.17249.77
5.4.100.0230.19849.77
5.4.90.0250.17649.77
5.4.80.0300.17549.77
5.4.70.0220.17549.76
5.4.60.0330.21349.76
5.4.50.0290.17949.76
5.4.40.0320.18549.75
5.4.30.0300.17849.75
5.4.20.0210.18349.75
5.4.10.0230.17349.75
5.4.00.0170.18449.23
5.3.290.0210.18350.50
5.3.280.0230.18250.42
5.3.270.0210.18750.43
5.3.260.0240.18150.43
5.3.250.0190.20550.43
5.3.240.0210.18950.43
5.3.230.0190.18850.43
5.3.220.0220.17750.39
5.3.210.0160.18250.39
5.3.200.0310.17050.39
5.3.190.0260.20250.39
5.3.180.0170.19050.39
5.3.170.0230.18050.39
5.3.160.0140.18550.38
5.3.150.0150.20450.38
5.3.140.0180.17950.38
5.3.130.0180.21250.37
5.3.120.0180.17950.37
5.3.110.0180.18550.38
5.3.100.0210.19049.86
5.3.90.0150.19149.84
5.3.80.0180.19049.83
5.3.70.0200.20549.83
5.3.60.0170.18450.11
5.3.50.0170.19549.77
5.3.40.0220.17849.77
5.3.30.0250.17349.73
5.3.20.0270.18049.51
5.3.10.0230.20749.46
5.3.00.0180.17749.75
5.2.170.0070.0269.18
5.2.160.0030.0309.18
5.2.150.0040.0299.18
5.2.140.0030.0329.18
5.2.130.0050.0339.14
5.2.120.0060.0409.14
5.2.110.0010.0319.14
5.2.100.0080.0289.14
5.2.90.0070.0329.14
5.2.80.0040.0329.14
5.2.70.0050.0299.14
5.2.60.0050.0289.09
5.2.50.0030.0319.06
5.2.40.0030.0319.04
5.2.30.0070.0279.02
5.2.20.0010.0329.00
5.2.10.0020.0298.93
5.2.00.0040.0298.79
5.1.60.0030.0248.07
5.1.50.0020.0268.07
5.1.40.0050.0268.05
5.1.30.0030.0288.40
5.1.20.0040.0298.42
5.1.10.0080.0248.14
5.1.00.0010.0288.15
5.0.50.0030.0216.62
5.0.40.0030.0196.48
5.0.30.0020.0326.29
5.0.20.0030.0206.26
5.0.10.0040.0196.25
5.0.00.0000.0336.24
4.4.90.0030.0154.78
4.4.80.0020.0164.75
4.4.70.0030.0154.75
4.4.60.0030.0154.75
4.4.50.0050.0134.77
4.4.40.0040.0244.71
4.4.30.0020.0164.76
4.4.20.0030.0154.85
4.4.10.0040.0154.84
4.4.00.0010.0264.76
4.3.110.0020.0164.67
4.3.100.0030.0154.66
4.3.90.0030.0144.64
4.3.80.0010.0294.59
4.3.70.0030.0164.63
4.3.60.0020.0194.63
4.3.50.0020.0164.63
4.3.40.0070.0204.54
4.3.30.0030.0153.29
4.3.20.0020.0163.27
4.3.10.0030.0143.22
4.3.00.0070.01013.43

preferences:
32.21 ms | 401 KiB | 5 Q