3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ [ "menu_id" => 7, "menu_name" => "Kasagbutan Meals", "menu_price" => "100.00", "qty" => "1", "special_instructions" => "" ], [ "menu_id" => 7, "special_instructions" => "", "menu_name" => "Kasagbutan Meals", "menu_price" => "100.00", "qty" => "1", ], [ "menu_id" => 6, "menu_name" => "Coke", "menu_price" => "50.00", "qty" => "1", "special_instructions" => "" ] ]; $exclude = array_flip(['qty']); $totals = array_reduce($arr, function($totals, $item) use ($exclude) { $id = array_diff_key($item, $exclude); ksort($id); $hash = crc32(json_encode($id)); if (array_key_exists($hash, $totals)) { $totals[$hash]['qty'] += $item['qty']; } else { $totals[$hash] = $item; } return $totals; }, []); print_r($totals);

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.0110.00920.66
8.4.110.0110.00722.40
8.4.100.0080.01017.62
8.4.90.0120.00920.53
8.4.80.0100.00818.96
8.4.70.0150.00517.92
8.4.60.0120.00918.81
8.4.50.0100.01017.62
8.4.40.0040.01517.58
8.4.30.0060.00320.30
8.4.20.0130.00617.78
8.4.10.0140.00322.34
8.3.250.0100.00918.83
8.3.240.0070.00516.85
8.3.230.0120.00816.61
8.3.220.0040.00318.97
8.3.210.0110.00716.58
8.3.200.0050.00516.50
8.3.190.0090.01017.16
8.3.180.0100.00916.61
8.3.170.0070.01119.29
8.3.160.0070.00716.61
8.3.150.0060.01217.16
8.3.140.0070.01117.11
8.3.130.0080.00018.42
8.3.120.0090.00618.82
8.3.110.0000.00820.94
8.3.100.0030.00616.40
8.3.90.0050.00326.77
8.3.80.0060.00316.50
8.3.70.0180.00316.58
8.3.60.0100.01018.56
8.3.50.0120.00424.43
8.3.40.0130.00718.83
8.3.30.0110.00718.83
8.3.20.0080.00024.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.290.0070.00717.06
8.2.280.0050.00418.20
8.2.270.0150.00416.69
8.2.260.0080.00016.59
8.2.250.0080.00016.72
8.2.240.0060.00317.22
8.2.230.0050.00322.58
8.2.220.0070.00724.06
8.2.210.0070.00426.77
8.2.200.0080.00016.63
8.2.190.0100.00716.75
8.2.180.0140.00725.92
8.2.170.0110.00418.82
8.2.160.0140.00022.96
8.2.150.0080.00025.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00426.35
8.2.110.0040.00722.07
8.2.100.0130.00017.91
8.2.90.0040.00417.75
8.2.80.0040.00418.78
8.2.70.0030.00718.05
8.2.60.0030.00518.22
8.2.50.0080.00018.10
8.2.40.0000.00819.41
8.2.30.0060.00319.33
8.2.20.0040.00418.03
8.2.10.0020.00519.24
8.2.00.0000.00719.43
8.1.330.0100.00918.51
8.1.320.0130.00816.13
8.1.310.0080.00018.44
8.1.300.0090.00017.88
8.1.290.0050.00530.84
8.1.280.0110.00425.92
8.1.270.0000.00823.99
8.1.260.0050.00328.09
8.1.250.0040.00428.09
8.1.240.0050.00519.21
8.1.230.0040.00820.96
8.1.220.0000.00817.79
8.1.210.0050.00318.77
8.1.200.0100.00017.47
8.1.190.0040.00417.23
8.1.180.0050.00318.10
8.1.170.0050.00318.64
8.1.160.0040.00419.09
8.1.150.0000.00818.91
8.1.140.0000.00718.85
8.1.130.0070.00017.39
8.1.120.0000.00817.43
8.1.110.0040.00417.50
8.1.100.0000.00717.49
8.1.90.0070.00017.36
8.1.80.0000.00717.45
8.1.70.0000.00917.47
8.1.60.0000.00817.50
8.1.50.0000.00817.52
8.1.40.0030.00617.57
8.1.30.0000.00917.66
8.1.20.0000.00817.66
8.1.10.0030.00917.51
8.1.00.0040.00417.38
8.0.300.0050.00218.77
8.0.290.0000.00816.63
8.0.280.0000.00718.46
8.0.270.0070.00016.72
8.0.260.0030.00316.85
8.0.250.0070.00016.96
8.0.240.0000.00716.98
8.0.230.0030.00317.05
8.0.220.0040.00416.93
8.0.210.0070.00016.93
8.0.200.0000.00716.85
8.0.190.0040.00416.92
8.0.180.0000.00816.93
8.0.170.0030.00616.88
8.0.160.0030.00516.93
8.0.150.0080.00016.76
8.0.140.0040.00416.88
8.0.130.0000.00513.37
8.0.120.0040.00416.73
8.0.110.0030.00616.80
8.0.100.0070.00016.87
8.0.90.0050.00216.77
8.0.80.0050.01216.90
8.0.70.0040.00416.93
8.0.60.0000.00716.84
8.0.50.0050.00516.92
8.0.30.0080.01717.13
8.0.20.0130.01417.07
8.0.10.0040.00417.09
8.0.00.0150.00316.88
7.4.330.0000.00515.55
7.4.320.0030.00316.53
7.4.300.0030.00316.61
7.4.290.0030.00316.56
7.4.280.0000.00816.36
7.4.270.0000.00716.67
7.4.260.0030.00313.21
7.4.250.0000.00816.34
7.4.240.0040.00416.60
7.4.230.0030.00316.73
7.4.220.0030.00416.38
7.4.210.0070.00716.56
7.4.200.0000.00716.44
7.4.130.0090.01016.56
7.4.120.0130.00416.50
7.4.110.0110.00816.61
7.4.100.0030.01416.63
7.4.90.0140.00316.41
7.4.80.0100.00719.39
7.4.70.0070.01416.33
7.4.60.0060.01516.38
7.4.50.0130.00416.38
7.4.40.0110.01016.47
7.4.30.0150.00916.41
7.4.20.0170.00016.33
7.4.10.0080.00816.47
7.4.00.0090.01316.34
7.3.330.0000.00816.21
7.3.320.0030.00313.41
7.3.310.0030.00616.26
7.3.300.0040.00416.34
7.3.290.0060.01016.37
7.3.280.0140.00016.34
7.3.260.0130.00516.47
7.3.230.0170.00716.64
7.3.210.0140.00416.50
7.3.200.0100.00616.36
7.3.190.0100.01016.25
7.3.180.0060.01316.14
7.3.170.0070.01516.45
7.3.160.0030.01416.21
7.3.150.0070.01416.23
7.3.140.0060.01716.29
7.3.130.0170.00016.48
7.3.120.0060.01616.52
7.3.110.0120.00616.34
7.3.100.0070.01016.09
7.3.90.0100.01416.33
7.3.80.0030.01416.46
7.3.70.0070.01016.20
7.3.60.0030.01416.35
7.3.50.0030.01416.24
7.3.40.0080.01216.39
7.3.30.0090.00916.38
7.3.20.0130.00716.35
7.3.10.0160.00616.34
7.3.00.0140.00716.21
7.2.330.0070.01016.73
7.2.310.0070.01616.65
7.2.300.0130.00916.49
7.2.290.0040.01416.64
7.2.280.0090.01216.65
7.2.270.0130.01016.71
7.2.260.0140.00316.58
7.2.250.0120.00616.68
7.2.240.0060.01216.33
7.2.230.0140.00416.62
7.2.220.0060.01316.55
7.2.210.0070.01016.40
7.2.200.0070.01416.42
7.2.190.0120.00616.28
7.2.180.0000.02216.32
7.2.170.0060.01516.42
7.2.160.0090.01216.60
7.2.150.0130.01016.55
7.2.140.0140.00316.66
7.2.130.0070.01316.58
7.2.120.0190.00516.37
7.2.110.0000.02316.33
7.2.100.0180.00616.55
7.2.90.0140.00716.31
7.2.80.0780.00316.36
7.2.70.0110.00716.53
7.2.60.0060.01616.27
7.2.50.0040.01516.49
7.2.40.0030.01516.63
7.2.30.0040.01516.73
7.2.20.0120.00616.38
7.2.10.0090.00916.34
7.2.00.0070.01116.65

preferences:
27.88 ms | 403 KiB | 5 Q