3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ["item_id" => "1", "customer_id" => "53453", "name" => "Item3", "price" => 0, "quantity" => 1], ["item_id" => "3","customer_id" => "53453","name" => "Item1","price" => 0,"quantity" => 1], ["item_id" => "2","customer_id" => "765656","name" => "Item2","price" => 0,"quantity" => 1], ]; $finalArray = []; foreach ($array as $item) { $customer_id = $item['customer_id']; $finalArray[$customer_id][] = [ 'name' => $item['name'], 'price' => $item['price'], 'quantity' => $item['quantity'], ]; } print_r($finalArray);

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.140.0140.00617.37
8.4.130.0080.00119.01
8.4.120.0100.00724.21
8.4.110.0100.01118.87
8.4.100.0110.00918.95
8.4.90.0120.00720.51
8.4.80.0090.00117.73
8.4.70.0130.00717.84
8.4.60.0140.00718.93
8.4.50.0120.00817.63
8.4.40.0100.01017.66
8.4.30.0030.00520.40
8.4.20.0180.00417.93
8.4.10.0060.00317.73
8.3.270.0160.00416.70
8.3.260.0060.00216.32
8.3.250.0110.00718.81
8.3.240.0150.00416.94
8.3.230.0110.00818.43
8.3.220.0110.00619.09
8.3.210.0090.00916.68
8.3.200.0050.00416.52
8.3.190.0110.00816.44
8.3.180.0050.00316.68
8.3.170.0180.00016.60
8.3.160.0090.00918.29
8.3.150.0070.01119.00
8.3.140.0120.00320.77
8.3.130.0090.00618.36
8.3.120.0040.00418.86
8.3.110.0040.00420.94
8.3.100.0090.00624.06
8.3.90.0040.00726.77
8.3.80.0040.00416.75
8.3.70.0140.00316.74
8.3.60.0070.00718.23
8.3.50.0170.00016.29
8.3.40.0090.00618.59
8.3.30.0150.00018.71
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0050.00326.16
8.2.290.0070.00320.74
8.2.280.0070.00418.27
8.2.270.0090.00916.72
8.2.260.0090.00917.04
8.2.250.0080.00016.48
8.2.240.0050.00519.05
8.2.230.0040.00422.58
8.2.220.0070.00437.54
8.2.210.0130.00626.77
8.2.200.0090.00016.63
8.2.190.0160.00616.63
8.2.180.0200.00025.92
8.2.170.0070.01019.03
8.2.160.0140.00022.96
8.2.150.0070.00025.66
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0000.00826.35
8.2.110.0060.00320.91
8.2.100.0030.01017.91
8.2.90.0000.00919.25
8.2.80.0090.00017.97
8.2.70.0000.00917.63
8.2.60.0040.00418.04
8.2.50.0060.00318.07
8.2.40.0050.00318.16
8.2.30.0040.00418.00
8.2.20.0000.00718.18
8.2.10.0000.00719.35
8.2.00.0080.00019.29
8.1.330.0100.00822.18
8.1.320.0100.00816.13
8.1.310.0140.00316.54
8.1.300.0060.00317.85
8.1.290.0040.00718.88
8.1.280.0080.00825.92
8.1.270.0080.00023.99
8.1.260.0000.00728.09
8.1.250.0000.00728.09
8.1.240.0000.00822.61
8.1.230.0030.00818.98
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0060.00317.23
8.1.190.0040.00417.23
8.1.180.0060.00318.10
8.1.170.0040.00418.30
8.1.160.0030.00518.87
8.1.150.0000.00719.00
8.1.140.0000.00818.86
8.1.130.0000.00720.01
8.1.120.0040.00417.48
8.1.110.0000.00817.48
8.1.100.0040.00417.35
8.1.90.0030.00417.32
8.1.80.0060.00317.50
8.1.70.0000.00717.49
8.1.60.0040.00417.59
8.1.50.0000.00817.57
8.1.40.0050.00317.53
8.1.30.0000.00817.57
8.1.20.0080.00017.70
8.1.10.0000.00817.53
8.1.00.0100.00017.37
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0030.00318.42
8.0.270.0070.00017.98
8.0.260.0040.00418.50
8.0.250.0000.00716.86
8.0.240.0030.00616.99
8.0.230.0000.00816.92
8.0.220.0070.00016.90
8.0.210.0040.00416.75
8.0.200.0050.00316.98
8.0.190.0050.00316.88
8.0.180.0000.00716.82
8.0.170.0040.00416.79
8.0.160.0040.00416.93
8.0.150.0030.00316.71
8.0.140.0000.00916.73
8.0.130.0030.00313.38
8.0.120.0040.00716.89
8.0.110.0040.00416.83
8.0.100.0000.00816.87
8.0.90.0040.00416.76
8.0.80.0070.01316.82
8.0.70.0070.00016.87
8.0.60.0000.00816.78
8.0.50.0030.00516.90
8.0.30.0100.00716.89
8.0.20.0100.01316.92
8.0.10.0090.00617.04
8.0.00.0120.00916.93
7.4.330.0040.00015.55
7.4.320.0000.00716.51
7.4.300.0060.00016.52
7.4.290.0070.00016.55
7.4.280.0050.00216.49
7.4.270.0040.00416.63
7.4.260.0050.00013.27
7.4.250.0050.00316.58
7.4.240.0000.00716.62
7.4.230.0000.00816.48
7.4.220.0000.00716.44
7.4.210.0050.01116.57
7.4.200.0030.00316.70
7.4.160.0140.00616.54
7.4.150.0040.01116.42
7.4.140.0070.00716.56
7.4.130.0150.00716.48
7.4.120.0040.01616.36
7.4.110.0060.01616.32
7.4.100.0080.01216.54
7.4.90.0100.01016.38
7.4.80.0120.00616.41
7.4.70.0000.01516.50
7.4.60.0170.00016.35
7.4.50.0100.01016.42
7.4.40.0090.01016.40
7.4.30.0120.00316.40
7.4.20.0070.01016.51
7.4.10.0080.01116.55
7.4.00.0030.01416.63
7.3.330.0000.00716.10
7.3.320.0000.00613.22
7.3.310.0030.00316.24
7.3.300.0000.00616.22
7.3.290.0090.00516.32
7.3.270.0100.00316.22
7.3.260.0000.01416.42
7.3.250.0030.01816.32
7.3.240.0100.00716.26
7.3.230.0160.00316.30
7.3.220.0110.00616.29
7.3.210.0180.00016.15
7.3.200.0040.01116.37
7.3.190.0080.00816.28
7.3.180.0000.01516.29
7.3.170.0110.00716.27
7.3.160.0060.00916.24
7.3.150.0040.01116.25
7.3.140.0070.01116.36
7.3.130.0110.00716.23
7.3.120.0100.00716.22
7.3.110.0070.01016.15
7.3.100.0030.01316.19
7.3.90.0100.00716.55
7.3.80.0070.00716.21
7.3.70.0110.00416.47
7.3.60.0090.00616.43
7.3.50.0090.00616.44
7.3.40.0030.01216.37
7.3.30.0040.01516.36
7.3.20.0090.00916.46
7.3.10.0100.01016.32
7.3.00.0030.01716.40

preferences:
32.21 ms | 403 KiB | 5 Q