3v4l.org

run code in 300+ PHP versions simultaneously
<?php $the_array = [ ['id' => 1, 'value' => 10, 'name' => 'apple'], ['id' => 1, 'value' => 20, 'name' => 'orange'], ['id' => 1, 'value' => 30, 'name' => 'banana'], ['id' => 2, 'value' => 100, 'name' => 'car'], ['id' => 2, 'value' => 200, 'name' => 'bicycle'], ]; var_export( array_values( array_reduce( $the_array, function ($carry, $row) { if (!isset($carry[$row['id']])) { $carry[$row['id']] = $row; } else { $carry[$row['id']]['value'] += $row['value']; $carry[$row['id']]['name'] .= ",{$row['name']}"; } return $carry; } ) ) );

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.120.0050.00622.58
8.4.110.0070.00322.55
8.4.100.0130.00917.78
8.4.90.0160.00518.64
8.4.80.0140.00718.90
8.4.70.0090.00417.88
8.4.60.0100.01018.77
8.4.50.0160.00517.73
8.4.40.0090.01219.46
8.4.30.0190.00020.51
8.4.20.0100.00618.88
8.4.10.0000.00917.58
8.3.250.0100.00919.01
8.3.240.0050.00416.66
8.3.230.0160.00416.81
8.3.220.0050.00319.08
8.3.210.0110.00816.43
8.3.200.0070.00216.86
8.3.190.0060.00118.81
8.3.180.0100.00917.37
8.3.170.0130.00616.52
8.3.160.0110.00716.50
8.3.150.0120.00618.94
8.3.140.0050.00316.59
8.3.130.0040.00416.68
8.3.120.0060.00320.45
8.3.110.0030.00720.94
8.3.100.0190.00016.59
8.3.90.0050.00526.77
8.3.80.0050.00519.36
8.3.70.0140.00318.40
8.3.60.0070.00716.59
8.3.50.0120.00316.54
8.3.40.0080.00818.70
8.3.30.0110.00418.51
8.3.20.0040.00424.18
8.3.10.0030.00524.66
8.3.00.0080.00026.16
8.2.290.0050.00522.26
8.2.280.0060.00218.46
8.2.270.0190.00017.29
8.2.260.0040.00419.21
8.2.250.0110.00718.21
8.2.240.0070.00317.11
8.2.230.0080.00022.58
8.2.220.0130.00624.06
8.2.210.0000.00826.77
8.2.200.0060.00318.88
8.2.190.0110.00418.16
8.2.180.0070.00725.92
8.2.170.0040.01119.04
8.2.160.0110.00722.96
8.2.150.0070.00025.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00420.02
8.2.110.0060.00319.29
8.2.100.0120.00017.84
8.2.90.0000.00817.75
8.2.80.0040.00418.78
8.2.70.0060.00319.38
8.2.60.0000.00817.75
8.2.50.0050.00318.10
8.2.40.0030.00521.02
8.2.30.0000.00919.23
8.2.20.0050.00218.17
8.2.10.0070.00418.51
8.2.00.0030.00618.56
8.1.330.0120.00521.75
8.1.320.0140.00516.31
8.1.310.0060.00316.57
8.1.300.0000.01418.64
8.1.290.0030.00630.84
8.1.280.0100.01025.92
8.1.270.0070.00023.99
8.1.260.0080.00026.35
8.1.250.0070.01028.09
8.1.240.0070.00319.46
8.1.230.0070.00420.27
8.1.220.0000.00818.77
8.1.210.0080.00018.84
8.1.200.0000.00817.35
8.1.190.0040.00417.35
8.1.180.0030.00518.10
8.1.170.0030.00618.59
8.1.160.0000.00718.96
8.1.150.0040.00418.96
8.1.140.0050.00519.13
8.1.130.0040.00618.88
8.1.120.0040.00517.53
8.1.110.0060.00317.52
8.1.100.0040.00617.45
8.1.90.0050.00517.40
8.1.80.0050.00617.42
8.1.70.0020.00817.46
8.1.60.0040.00617.56
8.1.50.0020.00617.47
8.1.40.0030.00717.53
8.1.30.0080.00617.65
8.1.20.0120.00117.68
8.1.10.0090.00517.60
8.1.00.0110.00117.42
8.0.300.0000.00819.85
8.0.290.0060.00316.75
8.0.280.0070.00018.45
8.0.270.0080.00017.26
8.0.260.0040.00717.61
8.0.250.0090.00216.88
8.0.240.0090.00416.85
8.0.230.0030.00616.79
8.0.220.0050.00516.78
8.0.210.0020.00816.91
8.0.200.0060.00516.80
8.0.190.0090.00116.86
8.0.180.0060.00316.83
8.0.170.0040.00816.77
8.0.160.0030.00616.89
8.0.150.0060.00216.81
8.0.140.0000.00916.85
8.0.130.0040.00515.07
8.0.120.0070.00316.72
8.0.110.0060.00416.80
8.0.100.0070.00516.80
8.0.90.0070.00316.84
8.0.80.0100.00416.87
8.0.70.0030.00616.82
8.0.60.0060.00416.85
8.0.50.0020.00616.72
8.0.30.0050.00916.81
8.0.20.0090.00516.86
8.0.10.0100.00616.82
8.0.00.0070.00816.91
7.4.330.0110.00516.89
7.4.320.0090.00316.44
7.4.300.0110.00316.54
7.4.290.0070.00516.55
7.4.280.0070.00516.38
7.4.270.0060.00516.55
7.4.260.0080.00314.88
7.4.250.0080.00516.41
7.4.240.0080.00216.50
7.4.230.0060.00516.44
7.4.220.0060.00416.52
7.4.210.0080.00716.58
7.4.200.0040.00716.55
7.4.190.0100.00416.50
7.4.180.0110.00416.65
7.4.160.0090.00816.64
7.4.150.0090.00616.51
7.4.140.0100.00816.38
7.4.130.0070.00816.38
7.4.120.0110.00616.35
7.4.110.0080.00616.44
7.4.100.0070.00716.45
7.4.90.0090.00616.49
7.4.80.0120.00316.38
7.4.70.0090.00516.41
7.4.60.0060.00916.33
7.4.50.0120.00316.44
7.4.40.0070.01016.37
7.4.30.0130.00216.37
7.4.20.0110.00616.43
7.4.10.0110.00316.51
7.4.00.0110.00716.57
7.3.330.0070.00416.33
7.3.320.0090.00214.78
7.3.310.0090.00216.25
7.3.300.0020.00916.21
7.3.290.0090.00816.35
7.3.280.0060.00916.30
7.3.270.0110.00616.30
7.3.260.0100.00716.35
7.3.250.0100.00416.88
7.3.240.0110.00416.40
7.3.230.0090.00616.23
7.3.220.0050.00816.28
7.3.210.0110.00516.27
7.3.200.0070.00816.21
7.3.190.0090.00616.26
7.3.180.0090.00516.23
7.3.170.0120.00316.28
7.3.160.0070.00716.25
7.3.150.0110.00516.31
7.3.140.0120.00316.24
7.3.130.0100.00516.23
7.3.120.0040.01316.24
7.3.110.0080.01116.24
7.3.100.0120.00516.14
7.3.90.0090.00716.49
7.3.80.0100.00516.22
7.3.70.0130.00216.37
7.3.60.0090.00516.38
7.3.50.0100.00516.44
7.3.40.0090.00516.35
7.3.30.0110.00316.49
7.3.20.0180.00516.44
7.3.10.0080.00716.34
7.3.00.0090.00716.32

preferences:
30.17 ms | 403 KiB | 5 Q