3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 0 => [ 0 => [ "Product_Name" => "Apple Pie - 8", "Product_Qty" => 1, "Product_Cat" => "Pies" ], 1 => [ "Product_Name" => "Apple Pie - 8", "Product_Qty" => 1, "Product_Cat" => "Pies" ] ], 1 => [ 0 => [ "Product_Name" => "Pecan Pie - 8", "Product_Qty" => 1, "Product_Cat" => "Pies" ] ], 2 => [ 0 => [ "Product_Name" => "Strawberry Pie - 8", "Product_Qty" => 1, "Product_Cat" => "Pies" ], 1 => [ "Product_Name" => "Pecan Pie - 8", "Product_Qty" => 1, "Product_Cat" => "Pies" ] ], 3 => [ 0 => [ "Product_Name" => "Lemon Pie - 8", "Product_Qty" => 1, "Product_Cat" => "Pies" ], 1 => [ "Product_Name" => "Pecan Pie - 8", "Product_Qty" => 1, "Product_Cat" => "Pies" ] ] ]; $result = []; foreach ( array_merge(...$array) as ['Product_Name' => $n, 'Product_Qty' => $q] ) { $result[$n] = ($result[$n] ?? 0) + $q; } var_export($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.0140.00717.76
8.4.120.0070.01422.27
8.4.110.0110.01422.21
8.4.100.0110.00918.33
8.4.90.0110.00518.82
8.4.80.0080.00920.62
8.4.70.0120.00817.89
8.4.60.0110.00918.88
8.4.50.0080.01120.43
8.4.40.0100.01017.67
8.4.30.0080.00018.74
8.4.20.0070.01117.75
8.4.10.0130.00319.11
8.3.260.0110.00816.54
8.3.250.0110.00818.62
8.3.240.0110.00816.45
8.3.230.0100.00516.52
8.3.220.0070.00819.05
8.3.210.0100.00716.64
8.3.200.0060.00216.35
8.3.190.0090.01017.04
8.3.180.0130.00617.09
8.3.170.0100.00720.96
8.3.160.0100.00718.62
8.3.150.0100.01017.18
8.3.140.0080.00016.50
8.3.130.0050.00518.30
8.3.120.0000.00920.87
8.3.110.0090.00620.94
8.3.100.0000.01116.38
8.3.90.0150.00026.77
8.3.80.0040.00418.43
8.3.70.0140.00716.63
8.3.60.0100.01018.23
8.3.50.0170.00716.66
8.3.40.0120.00323.56
8.3.30.0140.00020.10
8.3.20.0000.00724.18
8.3.10.0130.00621.89
8.3.00.0130.00720.57
8.2.290.0110.00720.47
8.2.280.0120.00818.40
8.2.270.0080.00017.00
8.2.260.0110.00716.58
8.2.250.0040.00418.38
8.2.240.0070.00019.20
8.2.230.0090.00022.58
8.2.220.0000.00924.06
8.2.210.0040.00426.77
8.2.200.0090.00018.17
8.2.190.0110.00718.16
8.2.180.0180.00325.92
8.2.170.0110.00318.98
8.2.160.0090.00622.96
8.2.150.0080.00025.66
8.2.140.0140.00421.98
8.2.130.0070.01122.20
8.2.120.0180.00020.75
8.2.110.0100.01020.83
8.2.100.0160.00320.70
8.2.90.0070.01120.56
8.2.80.0150.00420.66
8.2.70.0100.01020.66
8.2.60.0090.00920.45
8.2.50.0090.00620.35
8.2.40.0160.00620.73
8.2.30.0170.00320.38
8.2.20.0110.00720.62
8.2.10.0100.00720.41
8.2.00.0090.00620.54
8.1.330.0100.01121.92
8.1.320.0120.00716.11
8.1.310.0120.00618.32
8.1.300.0110.00818.32
8.1.290.0100.00030.84
8.1.280.0130.00325.92
8.1.270.0060.00923.75
8.1.260.0090.00623.84
8.1.250.0030.00624.01
8.1.240.0200.00720.53
8.1.230.0090.00320.39
8.1.220.0030.00520.60
8.1.210.0050.00320.29
8.1.200.0030.00520.59
8.1.190.0080.00020.54
8.1.180.0050.00320.29
8.1.170.0060.00320.34
8.1.160.0080.00020.25
8.1.150.0050.00320.25
8.1.140.0000.00820.11
8.1.130.0000.00820.52
8.1.120.0040.00420.38
8.1.110.0040.00420.33
8.1.100.0040.00420.32
8.1.90.0040.00420.29
8.1.80.0040.00420.37
8.1.70.0060.00620.38
8.1.60.0050.00320.48
8.1.50.0050.00320.33
8.1.40.0050.00320.54
8.1.30.0000.00820.54
8.1.20.0040.00420.52
8.1.10.0000.00920.38
8.1.00.0080.00020.40

preferences:
45.78 ms | 403 KiB | 5 Q