3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['user_id' => 82, 'ac_type' => 1], ['user_id' => 80, 'ac_type' => 5], ['user_id' => 76, 'ac_type' => 1], ['user_id' => 82, 'ac_type' => 2], ['user_id' => 80, 'ac_type' => 5] ]; foreach ($array as $a) { if (!isset($result[$a['user_id']])) { $result[$a['user_id']] = $a; // only store if first occurrence of user_id } } 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.3.60.0180.00418.48
8.3.50.0080.00519.79
8.3.40.0000.01520.34
8.3.30.0100.00318.91
8.3.20.0060.00324.18
8.3.10.0000.00824.66
8.3.00.0070.00026.16
8.2.180.0130.00925.92
8.2.170.0090.00622.96
8.2.160.0000.01722.96
8.2.150.0050.00225.66
8.2.140.0070.00024.66
8.2.130.0070.00026.16
8.2.120.0050.00326.16
8.2.110.0110.00019.29
8.2.100.0040.00817.84
8.2.90.0040.00418.34
8.2.80.0060.00318.16
8.2.70.0050.00317.63
8.2.60.0040.00417.63
8.2.50.0040.00417.93
8.2.40.0000.00818.05
8.2.30.0040.00418.13
8.2.20.0030.00520.31
8.2.10.0000.00818.16
8.2.00.0050.00319.16
8.1.280.0140.00325.92
8.1.270.0040.00423.99
8.1.260.0070.00026.35
8.1.250.0030.00628.09
8.1.240.0030.00623.97
8.1.230.0090.00320.84
8.1.220.0080.00017.79
8.1.210.0040.00420.57
8.1.200.0000.00917.13
8.1.190.0000.00817.35
8.1.180.0030.00518.10
8.1.170.0040.00417.62
8.1.160.0000.00718.80
8.1.150.0070.00018.55
8.1.140.0000.00717.39
8.1.130.0000.00718.88
8.1.120.0050.00317.37
8.1.110.0030.00517.35
8.1.100.0000.00717.50
8.1.90.0000.00817.34
8.1.80.0070.00017.46
8.1.70.0030.00317.44
8.1.60.0090.00417.44
8.1.50.0080.00817.40
8.1.40.0140.00317.39
8.1.30.0100.00717.58
8.1.20.0110.00017.63
8.1.10.0050.00517.51
8.1.00.0070.00417.39
8.0.300.0040.00419.83
8.0.290.0050.00216.75
8.0.280.0030.00318.38
8.0.270.0030.00316.76
8.0.260.0000.00618.49
8.0.250.0000.00716.96
8.0.240.0000.00916.98
8.0.230.0000.00716.86
8.0.220.0000.00716.93
8.0.210.0030.00316.89
8.0.200.0060.00016.87
8.0.190.0090.00316.86
8.0.180.0080.00316.81
8.0.170.0130.00016.76
8.0.160.0080.00316.78
8.0.150.0090.00316.71
8.0.140.0080.00416.68
8.0.130.0060.00716.87
8.0.120.0040.01116.87
8.0.110.0030.00916.87
8.0.100.0000.01216.86
8.0.90.0030.00716.88
8.0.80.0080.00316.80
8.0.70.0100.00316.87
8.0.60.0030.00516.80
8.0.50.0000.00716.82
8.0.30.0090.00016.80
8.0.20.0080.00016.78
8.0.10.0050.00316.99
7.4.330.0030.00315.55
7.4.320.0000.00616.50
7.4.300.0030.00316.49
7.4.290.0030.00316.37
7.4.280.0050.00516.49
7.4.270.0140.00216.57
7.4.260.0080.00816.57
7.4.250.0140.00316.38
7.4.240.0090.00616.48
7.4.230.0160.00016.49
7.4.220.0090.00616.52
7.4.210.0070.00716.50
7.4.200.0130.00316.55
7.4.190.0080.00816.68
7.4.180.0150.00016.70
7.4.160.0100.00016.49
7.4.150.0110.00316.54
7.4.140.0050.01016.37
7.4.130.0120.00616.34
7.4.120.0190.00016.46
7.4.110.0050.00516.45
7.4.100.0130.00016.40
7.4.90.0050.00516.50
7.4.80.0050.00516.37
7.4.70.0070.00316.47
7.4.60.0000.00916.33
7.4.50.0070.00316.27
7.4.40.0100.00016.39
7.4.30.0090.00016.30
7.4.20.0080.00016.43
7.4.10.0050.00516.40
7.4.00.0060.00616.46

preferences:
57.72 ms | 400 KiB | 5 Q