3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input_array = [ ['id' => 2, 'name' => 'ProductName', 'comment' => 'best product comment 1'], ['id' => 2, 'name' => 'ProductName', 'comment' => 'best product comment 2'], ['id' => 2, 'name' => 'ProductName', 'comment' => 'best product comment 3'], ['id' => 3, 'name' => 'ProductName2', 'comment' => 'best product comment 4'], ['id' => 3, 'name' => 'ProductName2', 'comment' => 'best product comment 5'] ]; $output_array = array_values(array_reduce($input_array, function($output_array, $item) { if (array_key_exists($item['id'], $output_array)) $output_array[$item['id']]['comment'][] = $item['comment']; else { $item['comment'] = (array)$item['comment']; $output_array[$item['id']] = $item; } return $output_array; }, [])); var_dump($output_array);

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.0090.01120.15
8.4.110.0170.00718.76
8.4.100.0150.00617.79
8.4.90.0110.00922.59
8.4.80.0110.01019.37
8.4.70.0040.00417.88
8.4.60.0100.01018.72
8.4.50.0120.01120.33
8.4.40.0120.00017.54
8.4.30.0070.01617.52
8.4.20.0030.00618.76
8.4.10.0090.00017.92
8.3.250.0090.00818.83
8.3.240.0100.00616.61
8.3.230.0130.00716.45
8.3.220.0030.00419.16
8.3.210.0090.00516.60
8.3.200.0090.01016.59
8.3.190.0100.00917.23
8.3.180.0140.00716.44
8.3.170.0120.00617.00
8.3.160.0170.00020.70
8.3.150.0140.00718.70
8.3.140.0150.00417.30
8.3.130.0160.00318.23
8.3.120.0070.01320.50
8.3.110.0080.00020.94
8.3.100.0060.00316.60
8.3.90.0060.00326.77
8.3.80.0030.00616.63
8.3.70.0120.00316.78
8.3.60.0120.00318.55
8.3.50.0070.00617.29
8.3.40.0120.00618.82
8.3.30.0090.00618.76
8.3.20.0040.00418.32
8.3.10.0080.00021.84
8.3.00.0040.00421.73
8.2.290.0120.00620.36
8.2.280.0100.00918.19
8.2.270.0120.00617.41
8.2.260.0060.00316.66
8.2.250.0040.01418.46
8.2.240.0060.00319.14
8.2.230.0050.00322.58
8.2.220.0090.00624.06
8.2.210.0090.00626.77
8.2.200.0030.00616.75
8.2.190.0120.00316.63
8.2.180.0120.00316.50
8.2.170.0030.01022.96
8.2.160.0090.01319.09
8.2.150.0000.00824.18
8.2.140.0060.00324.66
8.2.130.0040.00421.10
8.2.120.0040.00426.35
8.2.110.0040.00720.97
8.2.100.0090.00317.84
8.2.90.0000.00917.80
8.2.80.0000.00817.97
8.2.70.0030.00618.05
8.2.60.0040.00418.22
8.2.50.0000.00818.10
8.2.40.0040.00419.30
8.2.30.0070.00019.43
8.2.20.0080.00018.19
8.2.10.0040.00418.38
8.2.00.0040.00417.68
8.1.330.0100.00923.63
8.1.320.0120.00715.96
8.1.310.0180.00018.46
8.1.300.0110.00416.28
8.1.290.0040.00830.84
8.1.280.0130.00325.92
8.1.270.0040.00420.20
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00419.46
8.1.230.0090.00320.90
8.1.220.0080.00017.78
8.1.210.0030.00518.77
8.1.200.0060.00617.48
8.1.190.0080.00017.34
8.1.180.0000.00918.10
8.1.170.0000.00818.71
8.1.160.0040.00418.77
8.1.150.0040.00418.93
8.1.140.0040.00421.93
8.1.130.0000.00720.16
8.1.120.0000.00717.35
8.1.110.0070.00017.47
8.1.100.0000.00717.45
8.1.90.0030.00617.35
8.1.80.0040.00417.45
8.1.70.0040.00417.43
8.1.60.0000.00817.59
8.1.50.0080.00017.48
8.1.40.0000.00817.43
8.1.30.0040.00417.62
8.1.20.0050.00217.74
8.1.10.0040.00417.41
8.1.00.0040.00417.41
8.0.300.0070.00019.73
8.0.290.0040.00416.58
8.0.280.0000.00718.38
8.0.270.0030.00317.21
8.0.260.0030.00320.20
8.0.250.0030.00316.85
8.0.240.0050.00216.86
8.0.230.0030.00716.84
8.0.220.0080.00016.84
8.0.210.0040.00416.82
8.0.200.0060.00316.92
8.0.190.0040.00416.92
8.0.180.0000.00716.86
8.0.170.0040.00416.80
8.0.160.0050.00216.82
8.0.150.0000.00716.88
8.0.140.0040.00416.90
8.0.130.0030.00613.00
8.0.120.0040.00416.85
8.0.110.0040.00416.72
8.0.100.0040.00416.95
8.0.90.0000.00716.88
8.0.80.0060.00916.87
8.0.70.0000.00716.68
8.0.60.0000.00716.84
8.0.50.0030.00316.88
8.0.30.0100.00917.09
8.0.20.0100.01017.40
8.0.10.0030.00516.82
8.0.00.0090.00916.60
7.4.330.0000.00615.55
7.4.320.0030.00316.64
7.4.300.0050.00216.50
7.4.290.0000.00716.51
7.4.280.0000.00816.50
7.4.270.0040.00416.41
7.4.260.0040.00416.62
7.4.250.0060.00316.42
7.4.240.0040.00316.53
7.4.230.0050.00216.42
7.4.220.0000.00816.53
7.4.210.0080.00716.54
7.4.200.0070.00016.36
7.4.160.0100.00816.53
7.4.140.0100.01017.86
7.4.130.0120.00616.43
7.4.120.0100.01016.47
7.4.110.0060.01216.68
7.4.100.0040.01316.46
7.4.90.0050.01316.37
7.4.80.0100.00719.39
7.4.70.0070.01016.54
7.4.60.0140.00716.53
7.4.50.0050.00516.36
7.4.40.0090.00916.41
7.4.00.0100.00914.97
7.3.330.0000.00513.44
7.3.320.0000.00613.23
7.3.310.0000.00816.45
7.3.300.0030.00316.41
7.3.290.0070.00016.37
7.3.280.0080.01016.30
7.3.260.0130.00816.43
7.3.240.0080.01016.50
7.3.230.0090.00916.36
7.3.210.0080.01116.55
7.3.200.0080.01116.67
7.3.190.0040.01316.21
7.3.180.0140.00616.52
7.3.170.0130.00316.34
7.3.160.0160.00716.46
7.3.120.0080.01014.75
7.3.110.0070.01014.77
7.3.100.0020.01314.87
7.3.90.0040.01014.86
7.3.80.0060.00814.74
7.3.70.0040.00914.83
7.3.60.0060.00814.90
7.3.50.0040.01014.76
7.3.40.0080.00914.79
7.3.30.0060.00714.70
7.3.20.0040.00916.54
7.3.10.0010.01216.64
7.3.00.0080.00716.51
7.2.330.0130.00616.40
7.2.320.0090.01316.71
7.2.310.0120.00616.44
7.2.300.0170.00016.42
7.2.290.0160.00416.64
7.2.250.0080.01214.89
7.2.240.0070.01215.06
7.2.230.0060.00915.10
7.2.220.0040.01014.87
7.2.210.0070.00814.80
7.2.200.0020.01314.91
7.2.190.0080.00914.95
7.2.180.0070.00815.06
7.2.170.0080.00815.07
7.2.160.0000.01015.05
7.2.150.0100.00716.70
7.2.140.0140.00316.83
7.2.130.0060.00616.71
7.2.120.0040.00716.89
7.2.110.0050.00915.85
7.2.100.1660.00915.46
7.2.90.1660.00615.86
7.2.80.1990.01215.66
7.2.70.1620.01215.96
7.2.60.1970.00715.74
7.2.50.1680.01015.99
7.2.40.1710.00415.86
7.2.30.2020.00315.95
7.2.20.1620.00915.86
7.2.10.1650.01115.99
7.2.00.1160.00615.96
7.1.330.0090.00815.70
7.1.320.0060.00515.69
7.1.310.0030.01315.91
7.1.300.0040.01115.68
7.1.290.0090.00515.93
7.1.280.0070.00615.80
7.1.270.0020.00815.74
7.1.260.0050.01015.72
7.1.250.0030.01015.93
7.1.230.0280.00714.01
7.1.220.2550.00913.94
7.1.210.3620.00713.61
7.1.200.3650.00613.84
7.1.190.3310.00613.61
7.1.180.4130.00913.70
7.1.170.1950.00313.74
7.1.160.3620.01213.88
7.1.150.3880.00613.94
7.1.140.3040.00313.71
7.1.130.3790.00313.95
7.1.120.0150.00713.85
7.1.110.0140.01413.84
7.1.100.0180.00614.05
7.1.90.2950.01013.71
7.1.80.3840.00313.97
7.1.70.4260.01013.56
7.1.60.4100.00731.94
7.1.50.5710.00731.83
7.1.40.6320.01031.83
7.1.30.7080.00731.38
7.1.20.7070.01031.79
7.1.10.6480.01013.89
7.1.00.4450.00714.01
5.6.380.0070.01014.04

preferences:
30.67 ms | 403 KiB | 5 Q