3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['user_id' => 82, 'ac_type' => 1, 'irrelevant' => 'a'], ['user_id' => 80, 'ac_type' => 5, 'irrelevant' => 'b'], ['user_id' => 76, 'ac_type' => 1, 'irrelevant' => 'c'], ['user_id' => 82, 'ac_type' => 1, 'irrelevant' => 'd'], ['user_id' => 80, 'ac_type' => 5, 'irrelevant' => 'e'] ]; foreach ($array as $row) { $compositeKey = $row['user_id'] . '_' . $row['ac_type']; $result[$compositeKey] ??= $row; // only store if first occurrence of compositeKey } var_export(array_values($result)); // re-index and print

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.0130.00820.65
8.4.110.0090.01122.18
8.4.100.0100.01017.77
8.4.90.0120.00918.44
8.4.80.0060.00517.78
8.4.70.0030.00617.70
8.4.60.0130.00718.64
8.4.50.0090.01118.67
8.4.40.0120.01019.48
8.4.30.0100.01020.88
8.4.20.0160.00320.57
8.4.10.0070.01323.92
8.3.250.0140.00518.84
8.3.240.0090.00616.51
8.3.230.0120.00716.60
8.3.220.0110.00816.98
8.3.210.0050.00618.39
8.3.200.0030.00616.73
8.3.190.0060.00516.78
8.3.180.0110.00816.63
8.3.170.0090.00917.11
8.3.160.0100.00618.34
8.3.150.0030.00616.47
8.3.140.0000.00818.85
8.3.130.0040.00418.51
8.3.120.0050.00519.00
8.3.110.0120.00318.41
8.3.100.0060.00318.25
8.3.90.0030.00526.77
8.3.80.0060.00616.50
8.3.70.0130.01016.59
8.3.60.0120.00318.39
8.3.50.0040.01818.55
8.3.40.0180.00020.16
8.3.30.0130.00618.57
8.3.20.0140.00324.18
8.3.10.0000.00824.66
8.3.00.0130.00626.16
8.2.290.0150.00420.56
8.2.280.0100.00818.43
8.2.270.0040.01117.41
8.2.260.0080.00018.17
8.2.250.0040.00416.59
8.2.240.0110.00317.49
8.2.230.0040.00420.94
8.2.220.0130.00324.06
8.2.210.0040.00426.77
8.2.200.0110.00418.29
8.2.190.0150.00618.13
8.2.180.0180.00425.92
8.2.170.0120.00622.96
8.2.160.0100.01022.96
8.2.150.0110.00725.66
8.2.140.0030.01524.66
8.2.130.0040.01426.16
8.2.120.0040.00421.04
8.2.110.0070.00320.58
8.2.100.0040.00817.91
8.2.90.0080.00020.60
8.2.80.0060.00317.97
8.2.70.0000.00918.05
8.2.60.0030.00618.18
8.2.50.0000.00818.10
8.2.40.0080.00021.15
8.2.30.0040.00419.37
8.2.20.0030.00420.68
8.2.10.0040.00418.19
8.2.00.0000.00719.31
8.1.330.0110.00721.85
8.1.320.0100.01016.28
8.1.310.0120.00618.59
8.1.300.0090.00918.28
8.1.290.0000.01230.84
8.1.280.0090.01225.92
8.1.270.0090.00924.66
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0130.00923.89
8.1.230.0080.00320.71
8.1.220.0000.00717.75
8.1.210.0040.00718.79
8.1.200.0000.00817.35
8.1.190.0030.00617.23
8.1.180.0030.00618.10
8.1.170.0000.00918.69
8.1.160.0000.00718.89
8.1.150.0050.00218.64
8.1.140.0000.00717.45
8.1.130.0040.00418.54
8.1.120.0060.00318.70
8.1.110.0070.00318.60
8.1.100.0000.00718.83
8.1.90.0060.00318.71
8.1.80.0000.00718.61
8.1.70.0080.00018.78
8.1.60.0040.00418.79
8.1.50.0000.00918.79
8.1.40.0000.00818.84
8.1.30.0070.00018.84
8.1.20.0000.00718.85
8.1.10.0030.00518.78
8.1.00.0040.00418.72
8.0.300.0040.00420.02
8.0.290.0030.00616.63
8.0.280.0000.00718.45
8.0.270.0070.00017.25
8.0.260.0040.00418.06
8.0.250.0030.00318.02
8.0.240.0050.00217.92
8.0.230.0000.00818.07
8.0.220.0030.00317.96
8.0.210.0000.00717.96
8.0.200.0050.00318.00
8.0.190.0000.00817.96
8.0.180.0000.00818.08
8.0.170.0080.00017.98
8.0.160.0000.00717.94
8.0.150.0030.00317.91
8.0.140.0050.00217.93
8.0.130.0000.00718.05
8.0.120.0030.00317.90
8.0.110.0030.00317.93
8.0.100.0000.00717.96
8.0.90.0070.00018.10
8.0.80.0030.00318.05
8.0.70.0040.00418.05
8.0.60.0050.00318.00
8.0.50.0000.00718.00
8.0.30.0030.00318.01
8.0.20.0040.00418.12
8.0.10.0070.00018.05

preferences:
27.92 ms | 403 KiB | 5 Q