3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ 'Orders' => [ [ 'transaction_id' => '78078', 'date' => 1616277653, 'currency' => 'EUR', 'items' => [ ['title' => 'Title 1', 'quantity' => 200, 'price' => 2.1, 'sku' => '1T.810BK'], ['title' => 'Title 2', 'quantity' => 250, 'price' => 1.78, 'sku' => '1090.005BK'], ], ], [ 'transaction_id' => 78079, 'date' => 1616597838, 'currency' => 'EUR', 'items' => [ ['title' => 'title 3', 'quantity' => 3, 'price' => 118.3, 'sku' => '1.DIYBOX.ULT.638RE'], ], ], [ 'transaction_id' => 78080, 'date' => 1616598322, 'currency' => 'EUR', 'items' => [ ['title' => 'title 2', 'quantity' => 300, 'price' => 1.78, 'sku' => '1090.005BK'], ], ] ] ]; var_export( array_reduce( array_merge( ...array_column($data['Orders'], 'items') ), function($carry, $item) { $carry[$item['sku']] = ($carry[$item['sku']] ?? 0) + $item['quantity']; 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.140.0140.00717.68
8.4.130.0170.00418.65
8.4.120.0060.00522.52
8.4.110.0040.00419.59
8.4.100.0120.00917.73
8.4.90.0120.00820.71
8.4.80.0140.00919.11
8.4.70.0120.00917.86
8.4.60.0140.00720.30
8.4.50.0080.00017.89
8.4.40.0120.00817.82
8.4.30.0070.01020.66
8.4.20.0100.01418.02
8.4.10.0130.00617.77
8.3.270.0120.00716.46
8.3.260.0140.00516.38
8.3.250.0150.00416.49
8.3.240.0110.00816.76
8.3.230.0080.00316.61
8.3.220.0050.00919.04
8.3.210.0120.00816.42
8.3.200.0110.00916.61
8.3.190.0110.00918.59
8.3.180.0040.00416.41
8.3.170.0200.00018.77
8.3.160.0150.00318.47
8.3.150.0100.01017.15
8.3.140.0030.00716.46
8.3.130.0000.00818.28
8.3.120.0000.00819.05
8.3.110.0110.00716.25
8.3.100.0080.01116.29
8.3.90.0040.00426.77
8.3.80.0100.00019.36
8.3.70.0140.00316.58
8.3.60.0140.00018.32
8.3.50.0180.00418.15
8.3.40.0190.00318.70
8.3.30.0040.01118.39
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.290.0140.00818.74
8.2.280.0110.00820.13
8.2.270.0030.01617.20
8.2.260.0040.00419.12
8.2.250.0040.00416.47
8.2.240.0070.01017.30
8.2.230.0030.00620.94
8.2.220.0030.00524.06
8.2.210.0080.00026.77
8.2.200.0040.00418.88
8.2.190.0090.00618.18
8.2.180.0120.00325.92
8.2.170.0100.01019.08
8.2.160.0100.00322.96
8.2.150.0000.00725.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00021.07
8.2.110.0100.00019.21
8.2.100.0060.00617.91
8.2.90.0000.00817.79
8.2.80.0030.00519.11
8.2.70.0050.00317.63
8.2.60.0030.00517.63
8.2.50.0040.00418.07
8.2.40.0040.00418.08
8.2.30.0100.00218.14
8.2.20.0040.00418.02
8.2.10.0000.00719.43
8.2.00.0000.00719.43
8.1.330.0090.01016.50
8.1.320.0080.01016.40
8.1.310.0090.00918.55
8.1.300.0060.00318.69
8.1.290.0030.00830.84
8.1.280.0150.00625.92
8.1.270.0050.00323.99
8.1.260.0060.00926.35
8.1.250.0160.00328.09
8.1.240.0060.00322.04
8.1.230.0080.00320.95
8.1.220.0000.00817.79
8.1.210.0000.00819.04
8.1.200.0060.00317.36
8.1.190.0070.00717.13
8.1.180.0080.00018.10
8.1.170.0000.00718.58
8.1.160.0040.00418.89
8.1.150.0000.00718.91
8.1.140.0040.00418.86
8.1.130.0030.00317.53
8.1.120.0070.00017.36
8.1.110.0080.00017.49
8.1.100.0000.00817.43
8.1.90.0000.00717.46
8.1.80.0060.00617.32
8.1.70.0030.00617.34
8.1.60.0030.00617.49
8.1.50.0030.00617.46
8.1.40.0000.00817.51
8.1.30.0030.00617.50
8.1.20.0030.00517.61
8.1.10.0000.00817.57
8.1.00.0050.00317.44
8.0.300.0030.00620.03
8.0.290.0040.00416.58
8.0.280.0080.00018.40
8.0.270.0050.00318.06
8.0.260.0060.00016.84
8.0.250.0040.00416.91
8.0.240.0000.00716.94
8.0.230.0110.00016.79
8.0.220.0000.00716.74
8.0.210.0030.00316.79
8.0.200.0000.00716.83
8.0.190.0040.00716.96
8.0.180.0040.00416.81
8.0.170.0000.01116.92
8.0.160.0050.00316.93
8.0.150.0000.00716.88
8.0.140.0040.00416.87
8.0.130.0000.00713.37
8.0.120.0040.00416.88
8.0.110.0050.00216.96
8.0.100.0000.00716.84
8.0.90.0030.00516.93
8.0.80.0120.00616.87
8.0.70.0070.00016.77
8.0.60.0070.00016.92
8.0.50.0040.00416.75
8.0.30.0120.00916.83
8.0.20.0100.01216.85
8.0.10.0060.01017.02
8.0.00.0120.00617.01
7.4.330.0030.00315.55
7.4.320.0000.00716.46
7.4.300.0060.00016.44
7.4.290.0030.00316.45
7.4.280.0030.00316.50
7.4.270.0040.00416.54
7.4.260.0030.00313.29
7.4.250.0030.00316.57
7.4.240.0050.00216.54
7.4.230.0000.00716.50
7.4.220.0050.00216.61
7.4.210.0070.00816.58
7.4.200.0000.00716.65
7.4.160.0040.01216.54
7.4.150.0100.01116.63
7.4.140.0110.00716.28
7.4.130.0090.00616.48
7.4.120.0120.00316.57
7.4.110.0080.00816.49
7.4.100.0100.01016.41
7.4.90.0100.00616.48
7.4.80.0090.00616.45
7.4.70.0030.01516.58
7.4.60.0120.00316.50
7.4.50.0060.00916.40
7.4.40.0080.01116.42
7.4.30.0120.00316.40
7.4.20.0090.01216.45
7.4.10.0030.01216.56
7.4.00.0030.01716.47
7.3.330.0060.00316.34
7.3.320.0000.00613.26
7.3.310.0000.00716.29
7.3.300.0030.00316.32
7.3.290.0030.01216.26
7.3.270.0100.01216.32
7.3.260.0130.00316.32
7.3.250.0140.00316.38
7.3.240.0100.00716.30
7.3.230.0080.00616.22
7.3.220.0160.00616.25
7.3.210.0070.01016.27
7.3.200.0060.01016.26
7.3.190.0110.00516.16
7.3.180.0090.00616.24
7.3.170.0110.00416.18
7.3.160.0120.00616.33
7.3.150.0030.01816.24
7.3.140.0120.00316.24
7.3.130.0130.00616.26
7.3.120.0030.01316.25
7.3.110.0070.00716.19
7.3.100.0030.01716.14
7.3.90.0080.01216.56
7.3.80.0040.01116.27
7.3.70.0140.00016.25
7.3.60.0040.01216.36
7.3.50.0120.00316.41
7.3.40.0060.00916.40
7.3.30.0100.01016.43
7.3.20.0070.01016.50
7.3.10.0000.01916.34
7.3.00.0040.01616.43

preferences:
39.31 ms | 403 KiB | 5 Q