3v4l.org

run code in 300+ PHP versions simultaneously
<?php $records = [ "Coding", "Web development - Coding", "Meeting", "Coding", "Coding", "Content", "Coding", "Coding" ]; $quantities = [ 3, 8, 1, 4.85, 1, 0.5, 6.01, 7 ]; $result = []; foreach ($records as $index => $label){ $result[$label] = ($result[$label] ?? 0) + $quantities[$index]; } var_export(array_keys($result)); var_export(array_values($result));

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)
8.4.130.0160.00517.82
8.4.120.0100.01120.39
8.4.110.0110.01022.51
8.4.100.0120.00917.65
8.4.90.0050.00418.57
8.4.80.0070.00217.50
8.4.70.0120.01017.54
8.4.60.0140.00618.57
8.4.50.0080.01219.32
8.4.40.0130.00617.42
8.4.30.0160.00320.42
8.4.20.0030.01618.02
8.4.10.0000.01720.36
8.3.260.0140.00516.42
8.3.250.0110.00718.83
8.3.240.0070.00216.80
8.3.230.0110.00916.47
8.3.220.0120.00619.13
8.3.210.0070.00316.63
8.3.200.0040.00516.34
8.3.190.0090.01016.49
8.3.180.0080.01016.68
8.3.170.0090.00616.91
8.3.160.0140.00418.25
8.3.150.0130.00716.49
8.3.140.0040.00416.64
8.3.130.0000.00816.72
8.3.120.0030.00620.86
8.3.110.0090.00018.21
8.3.100.0030.00616.43
8.3.90.0070.00026.77
8.3.80.0060.00319.36
8.3.70.0120.00316.58
8.3.60.0160.00316.48
8.3.50.0130.00723.66
8.3.40.0000.01521.79
8.3.30.0070.00718.48
8.3.20.0080.00024.18
8.3.10.0070.01124.66
8.3.00.0050.00326.16
8.2.290.0090.01020.32
8.2.280.0100.00920.08
8.2.270.0030.00717.27
8.2.260.0040.00417.08
8.2.250.0040.01118.48
8.2.240.0060.00318.57
8.2.230.0160.00320.94
8.2.220.0030.00724.06
8.2.210.0030.00626.77
8.2.200.0090.00018.88
8.2.190.0120.00316.58
8.2.180.0100.00725.92
8.2.170.0080.00819.08
8.2.160.0100.00722.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00319.77
8.2.110.0030.01722.18
8.2.100.0030.00919.51
8.2.90.0080.00017.75
8.2.80.0080.00018.88
8.2.70.0060.00317.50
8.2.60.0080.00617.53
8.2.50.0110.00517.59
8.2.40.0070.00518.05
8.2.30.0100.00317.75
8.2.20.0080.00617.67
8.2.10.0100.00218.26
8.2.00.0040.00918.43
8.1.330.0110.00721.61
8.1.320.0120.00716.19
8.1.310.0070.00718.41
8.1.300.0080.00816.02
8.1.290.0040.00430.84
8.1.280.0070.01025.92
8.1.270.0020.00524.66
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0080.00020.67
8.1.230.0040.00717.89
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0000.00917.36
8.1.190.0110.00317.11
8.1.180.0120.00217.55
8.1.170.0090.00417.71
8.1.160.0050.00817.89
8.1.150.0110.00218.00
8.1.140.0090.00417.88
8.1.130.0080.00518.44
8.1.120.0090.00317.37
8.1.110.0070.00617.34
8.1.100.0090.00317.37
8.1.90.0100.00417.29
8.1.80.0080.00417.32
8.1.70.0080.00417.12
8.1.60.0080.00617.35
8.1.50.0060.00617.39
8.1.40.0100.00517.49
8.1.30.0080.00617.50
8.1.20.0080.00517.43
8.1.10.0100.00417.19
8.1.00.0070.00617.27
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0110.00217.51
8.0.270.0090.00416.69
8.0.260.0070.00517.48
8.0.250.0080.00516.79
8.0.240.0040.00816.73
8.0.230.0070.00516.72
8.0.220.0060.00616.70
8.0.210.0110.00216.67
8.0.200.0100.00216.72
8.0.190.0100.00316.70
8.0.180.0070.00616.76
8.0.170.0090.00416.75
8.0.160.0110.00216.64
8.0.150.0090.00316.71
8.0.140.0090.00416.72
8.0.130.0080.00414.93
8.0.120.0080.00416.69
8.0.110.0070.00516.64
8.0.100.0080.00516.71
8.0.90.0050.00716.87
8.0.80.0080.00816.78
8.0.70.0060.00616.75
8.0.60.0070.00616.70
8.0.50.0090.00416.64
8.0.30.0090.01216.86
8.0.20.0170.00316.97
8.0.10.0080.00516.74
8.0.00.0120.00616.76
7.4.330.0080.00216.03
7.4.320.0090.00516.50
7.4.300.0080.00516.50
7.4.290.0110.00116.47
7.4.280.0080.00416.55
7.4.270.0060.00616.56
7.4.260.0050.00614.89
7.4.250.0100.00316.49
7.4.240.0080.00416.51
7.4.230.0050.00616.47
7.4.220.0090.00316.60
7.4.210.0110.00416.58
7.4.200.0080.00416.59
7.4.190.0050.01116.52
7.4.180.0110.00716.52
7.4.160.0170.00016.52
7.4.150.0090.00816.52
7.4.140.0090.00616.52
7.4.130.0110.00716.51
7.4.120.0140.00616.59
7.4.110.0160.00316.50
7.4.100.0090.00816.42
7.4.90.0100.00716.58
7.4.80.0120.00616.40
7.4.70.0100.00616.38
7.4.60.0130.00316.45
7.4.50.0160.00216.43
7.4.40.0130.00516.39
7.4.30.0110.00616.37
7.4.20.0060.00916.18
7.4.10.0140.00516.61
7.4.00.0100.00716.58
7.3.330.0120.00216.45
7.3.320.0070.00314.84
7.3.310.0080.00416.46
7.3.300.0070.00416.42
7.3.290.0100.00616.39
7.3.280.0090.00916.52
7.3.270.0160.00016.52
7.3.260.0110.01016.49
7.3.250.0090.00616.52
7.3.240.0120.00316.52
7.3.230.0150.00216.38
7.3.220.0110.00616.47
7.3.210.0080.00916.37
7.3.200.0140.00516.52
7.3.190.0120.00616.50
7.3.180.0120.00516.42
7.3.170.0130.00716.46
7.3.160.0110.00716.48
7.3.150.0110.00616.38
7.3.140.0110.00616.43
7.3.130.0120.00516.40
7.3.120.0130.00316.43
7.3.110.0150.00316.42
7.3.100.0090.00816.50
7.3.90.0120.00416.49
7.3.80.0120.00616.48
7.3.70.0100.00516.39
7.3.60.0070.01016.43
7.3.50.0150.00516.41
7.3.40.0130.00316.51
7.3.30.0150.00416.47
7.3.20.0130.00516.41
7.3.10.0130.00616.45
7.3.00.0140.00716.35
7.2.340.0130.00516.51
7.2.330.0130.00616.54
7.2.320.0120.00516.47
7.2.310.0120.00516.57
7.2.300.0140.00716.43
7.2.290.0130.00416.53
7.2.280.0070.00916.61
7.2.270.0110.00616.66
7.2.260.0110.00516.58
7.2.250.0120.00516.57
7.2.240.0130.00516.57
7.2.230.0060.01016.43
7.2.220.0060.01116.63
7.2.210.0040.01216.49
7.2.200.0080.01016.51
7.2.190.0110.00716.49
7.2.180.0140.00316.47
7.2.170.0120.00716.46
7.2.160.0090.01016.56
7.2.150.0110.00716.58
7.2.140.0100.00716.57
7.2.130.0080.01116.52
7.2.120.0120.01016.57
7.2.110.0170.00316.56
7.2.100.0070.01316.54
7.2.90.0110.00916.62
7.2.80.0140.00716.59
7.2.70.0170.00516.56
7.2.60.0120.00816.53
7.2.50.0100.00716.61
7.2.40.0110.00816.61
7.2.30.0100.00916.66
7.2.20.0110.00816.65
7.2.10.0120.00516.54
7.2.00.0100.00816.62
5.6.400.0040.00616.52

preferences:
28.72 ms | 403 KiB | 5 Q