3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ ['id' => 111, 'text' => 'yellow'], ['id' => 111, 'text' => 'red'], ['id' => 112, 'text' => 'green'], ]; $result = array_map(function($item) {return [ 'id' => $item['id'], 'text' => implode(', ', $item['colors']), ];}, array_reduce($data, function($reduced, $item){ if (!isset($reduced[$item['id']])) $reduced[$item['id']] = $item; $reduced[$item['id']]['colors'][] = $item['text']; return $reduced; }, [])); var_dump($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.3.60.0120.00818.55
8.3.50.0100.00917.44
8.3.40.0180.00018.93
8.3.30.0110.00418.71
8.3.20.0050.00221.95
8.3.10.0070.00321.95
8.3.00.0040.00423.56
8.2.180.0160.00616.38
8.2.170.0110.00722.96
8.2.160.0120.00320.52
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00020.02
8.2.110.0060.00320.53
8.2.100.0040.00717.91
8.2.90.0050.00317.84
8.2.80.0000.00818.05
8.2.70.0000.00818.16
8.2.60.0030.00618.22
8.2.50.0040.00418.10
8.2.40.0040.00419.48
8.2.30.0000.00719.37
8.2.20.0030.00518.23
8.2.10.0040.00418.99
8.2.00.0000.00719.35
8.1.280.0070.01525.92
8.1.270.0000.00922.21
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0030.00622.19
8.1.230.0080.00422.63
8.1.220.0060.00317.74
8.1.210.0060.00318.77
8.1.200.0040.00917.35
8.1.190.0030.00517.35
8.1.180.0050.00518.10
8.1.170.0080.00018.56
8.1.160.0040.00418.84
8.1.150.0000.00818.89
8.1.140.0000.00818.90
8.1.130.0060.00320.19
8.1.120.0000.00717.50
8.1.110.0060.00317.34
8.1.100.0000.00817.35
8.1.90.0040.00417.35
8.1.80.0050.00217.42
8.1.70.0040.00417.44
8.1.60.0080.00017.50
8.1.50.0000.00817.41
8.1.40.0060.00317.51
8.1.30.0000.00817.48
8.1.20.0030.00617.68
8.1.10.0030.00617.45
8.1.00.0050.00317.34
8.0.300.0070.00019.67
8.0.290.0050.00316.75
8.0.280.0040.00418.38
8.0.270.0030.00317.13
8.0.260.0000.00618.39
8.0.250.0000.00716.88
8.0.240.0070.00016.92
8.0.230.0000.00716.92
8.0.220.0000.00716.78
8.0.210.0000.00716.89
8.0.200.0000.00616.96
8.0.190.0070.00016.82
8.0.180.0000.00716.78
8.0.170.0050.00316.88
8.0.160.0040.00416.91
8.0.150.0030.00316.91
8.0.140.0000.00716.84
8.0.130.0030.00313.36
8.0.120.0040.00416.91
8.0.110.0050.00216.71
8.0.100.0040.00416.74
8.0.90.0040.00416.89
8.0.80.0060.00816.91
8.0.70.0000.00816.69
8.0.60.0000.00716.89
8.0.50.0080.00016.91
8.0.30.0190.00217.13
8.0.20.0130.00617.11
8.0.10.0000.00717.07
8.0.00.0090.00916.81
7.4.330.0030.00315.55
7.4.320.0030.00316.45
7.4.300.0070.00016.64
7.4.290.0000.00816.65
7.4.280.0030.00616.48
7.4.270.0030.00316.62
7.4.260.0070.00016.58
7.4.250.0070.00016.46
7.4.240.0040.00316.60
7.4.230.0030.00516.70
7.4.220.0000.00716.57
7.4.210.0090.00716.57
7.4.200.0070.00016.32
7.4.160.0090.00916.52
7.4.130.0080.00816.59
7.4.120.0040.01316.49
7.4.110.0120.00916.56
7.4.100.0060.01216.49
7.4.90.0150.00616.64
7.4.80.0110.00719.39
7.4.70.0070.01116.43
7.4.60.0070.01016.48
7.4.50.0040.01116.59
7.4.40.0040.01416.61
7.4.00.0070.01014.83
7.3.330.0000.00513.14
7.3.320.0060.00013.39
7.3.310.0040.00416.23
7.3.300.0000.00716.35
7.3.290.0000.00716.38
7.3.280.0070.01216.36
7.3.260.0120.00716.46
7.3.240.0100.00716.46
7.3.230.0190.00616.36
7.3.210.0090.00916.29
7.3.200.0080.00816.49
7.3.190.0100.01016.56
7.3.180.0070.01016.55
7.3.170.0030.01716.45
7.3.160.0100.00616.40
7.3.60.0060.00714.47
7.3.50.0090.00314.85
7.3.40.0080.00314.79
7.3.30.0030.00614.49
7.3.20.0030.01016.68
7.3.10.0100.00816.69
7.3.00.0070.00316.57
7.2.330.0120.00616.60
7.2.320.0140.00316.73
7.2.310.0070.01016.86
7.2.300.0100.00716.82
7.2.290.0080.00816.57
7.2.190.0070.00515.20
7.2.180.0000.01414.79
7.2.170.0040.00814.96
7.2.160.0070.01414.93
7.2.150.0120.00016.73
7.2.140.0090.00316.79
7.2.130.0090.00216.85
7.2.120.0100.00316.64
7.2.110.0000.01016.96
7.2.100.0130.00716.65
7.2.90.0070.01717.09
7.2.80.0090.00616.80
7.2.70.0030.00916.89
7.2.60.0030.01017.00
7.2.50.0060.01516.60
7.2.40.0090.00616.93
7.2.30.0060.00916.79
7.2.20.0090.00616.59
7.2.10.0070.00816.88
7.2.00.0080.00816.71
7.1.300.0230.00415.68
7.1.290.0070.00415.70
7.1.280.0060.00615.45
7.1.270.0130.00715.74
7.1.260.0100.00015.46
7.1.250.0170.00615.73

preferences:
64.22 ms | 401 KiB | 5 Q