3v4l.org

run code in 300+ PHP versions simultaneously
<?php function unique_multidim_array($array, $key) { $temp_array = array(); $i = 0; $key_array = array(); foreach($array as $val) { if (!in_array($val[$key], $key_array)) { $key_array[$i] = $val[$key]; $temp_array[$i] = $val; } $i++; } return $temp_array; } $content = [ [ "id" => 15710, "sale_id" => 6699, "item_id" => 300 ], [ "id" => 15711, "sale_id" => 6699, "item_id" => 300 ] ]; print_r(unique_multidim_array($content,'item_id')); ?>

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.5.10.0100.00716.68
8.5.00.0130.00920.24
8.4.150.0020.00014.05
8.4.140.0150.00717.48
8.4.130.0160.00517.57
8.4.120.0100.01124.34
8.4.110.0100.01022.57
8.4.100.0050.00319.10
8.4.90.0140.00618.83
8.4.80.0090.01119.48
8.4.70.0110.00918.00
8.4.60.0130.00719.09
8.4.50.0110.01020.32
8.4.40.0100.00617.56
8.4.30.0090.00922.45
8.4.20.0140.00718.70
8.4.10.0000.00919.49
8.3.280.0090.01118.29
8.3.270.0110.00916.76
8.3.260.0140.00716.84
8.3.250.0110.00718.92
8.3.240.0100.00817.16
8.3.230.0070.01416.66
8.3.220.0090.00917.06
8.3.210.0150.00516.73
8.3.200.0050.00316.40
8.3.190.0100.00817.08
8.3.180.0130.00516.64
8.3.170.0110.00716.79
8.3.160.0080.01218.31
8.3.150.0200.00316.56
8.3.140.0050.00318.81
8.3.130.0090.00016.50
8.3.120.0000.00918.80
8.3.110.0060.00320.94
8.3.100.0040.00424.06
8.3.90.0030.00526.77
8.3.80.0090.00016.75
8.3.70.0040.01116.75
8.3.60.0040.01818.43
8.3.50.0150.00518.27
8.3.40.0080.00818.77
8.3.30.0120.00318.79
8.3.20.0070.00021.03
8.3.10.0080.00020.16
8.3.00.0030.00523.48
8.2.290.0090.01020.40
8.2.280.0080.00918.26
8.2.270.0070.01116.38
8.2.260.0000.01016.73
8.2.250.0070.01016.78
8.2.240.0040.01117.22
8.2.230.0090.00022.58
8.2.220.0060.00337.54
8.2.210.0050.00326.77
8.2.200.0110.00016.50
8.2.190.0000.01516.60
8.2.180.0130.00316.50
8.2.170.0160.00322.96
8.2.160.0140.00321.14
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0050.00326.16
8.2.120.0060.00322.25
8.2.110.0090.00019.39
8.2.100.0090.00317.84
8.2.90.0040.00418.34
8.2.80.0070.00317.97
8.2.70.0060.00318.05
8.2.60.0030.00518.16
8.2.50.0040.00418.10
8.2.40.0060.00319.34
8.2.30.0070.00019.32
8.2.20.0060.00318.12
8.2.10.0000.00719.43
8.2.00.0000.00719.32
8.1.330.0120.00822.19
8.1.320.0100.01016.09
8.1.310.0090.00616.07
8.1.300.0040.01517.94
8.1.290.0090.00318.88
8.1.280.0150.00025.92
8.1.270.0060.00323.91
8.1.260.0030.00626.35
8.1.250.0050.00328.09
8.1.240.0070.00420.77
8.1.230.0080.00320.88
8.1.220.0070.00317.74
8.1.210.0090.00018.90
8.1.200.0060.00317.48
8.1.190.0060.00317.23
8.1.180.0000.00918.10
8.1.170.0000.00818.50
8.1.160.0000.00818.86
8.1.150.0060.00318.88
8.1.140.0040.00418.96
8.1.130.0050.00520.15
8.1.120.0030.00317.48
8.1.110.0040.00417.48
8.1.100.0030.00517.30
8.1.90.0030.00717.48
8.1.80.0040.00717.45
8.1.70.0090.00017.51
8.1.60.0000.00717.64
8.1.50.0060.00317.58
8.1.40.0000.00817.57
8.1.30.0040.00417.65
8.1.20.0030.00617.63
8.1.10.0030.00617.54
8.1.00.0000.00817.42
8.0.300.0040.00419.84
8.0.290.0080.00016.75
8.0.280.0040.00418.45
8.0.270.0070.00016.74
8.0.260.0000.00620.08
8.0.250.0020.00516.97
8.0.240.0000.00716.95
8.0.230.0060.00317.00
8.0.220.0040.00416.91
8.0.210.0030.00316.89
8.0.200.0000.00716.92
8.0.190.0030.00316.82
8.0.180.0000.00716.81
8.0.170.0040.00416.90
8.0.160.0040.00416.86
8.0.150.0070.00016.85
8.0.140.0080.00016.88
8.0.130.0030.00313.34
8.0.120.0040.00416.79
8.0.110.0070.00016.86
8.0.100.0040.00417.01
8.0.90.0040.00416.84
8.0.80.0100.00916.90
8.0.70.0040.00416.89
8.0.60.0050.00216.73
8.0.50.0000.00716.83
8.0.30.0110.00717.13
8.0.20.0130.01317.00
8.0.10.0040.00416.91
8.0.00.0110.00616.77
7.4.330.0040.00015.55
7.4.320.0030.00316.55
7.4.300.0000.00816.59
7.4.290.0070.00016.51
7.4.280.0030.00516.45
7.4.270.0000.00616.57
7.4.260.0020.00516.64
7.4.250.0000.00716.48
7.4.240.0020.00516.62
7.4.230.0070.00016.40
7.4.220.0030.00516.49
7.4.210.0060.01116.60
7.4.200.0040.00416.40
7.4.140.0100.00717.86
7.4.130.0070.01016.29
7.4.120.0150.00316.50
7.4.110.0080.00816.35
7.4.100.0100.00816.64
7.4.90.0110.00616.42
7.4.80.0030.01919.39
7.4.70.0130.00516.59
7.4.60.0100.01016.56
7.4.50.0090.00616.74
7.4.40.0040.01716.43
7.4.00.0130.00314.86
7.3.330.0000.00513.38
7.3.320.0000.00613.23
7.3.310.0070.00016.23
7.3.300.0070.00016.38
7.3.290.0090.01216.32
7.3.280.0130.00416.32
7.3.260.0100.00916.52
7.3.240.0090.00816.49
7.3.230.0110.00616.57
7.3.210.0090.00816.61
7.3.200.0090.00916.48
7.3.190.0050.01016.33
7.3.180.0060.01016.54
7.3.170.0100.00716.39
7.3.160.0070.01116.39
7.3.60.0110.01014.78
7.3.50.0110.00214.57
7.3.40.0160.00714.55
7.3.30.0030.01014.92
7.3.20.0090.01316.50
7.3.10.0160.00616.52
7.3.00.0090.00516.56
7.2.330.0130.00316.70
7.2.320.0100.01016.66
7.2.310.0070.01016.67
7.2.300.0160.00616.53
7.2.290.0030.01216.61
7.2.190.0120.00015.18
7.2.180.0060.00614.86
7.2.170.0100.00414.95
7.2.160.0070.00715.04
7.2.150.0140.01116.96
7.2.140.0150.00016.77
7.2.130.0080.01216.99
7.2.120.0070.00717.05
7.2.110.0090.00616.59
7.2.100.0030.01016.99
7.2.90.0110.00417.03
7.2.80.0000.01416.77
7.2.70.0180.00317.21
7.2.60.0040.00816.98
7.2.50.0100.01317.17
7.2.40.0140.01017.03
7.2.30.0030.01017.11
7.2.20.0040.01316.91
7.2.10.0170.00716.96
7.2.00.0100.00316.73
7.1.300.0090.01215.76
7.1.290.0100.00715.89
7.1.280.0040.01215.77
7.1.270.0060.00615.58
7.1.260.0090.00515.65
7.1.250.0050.00915.86

preferences:
47.06 ms | 403 KiB | 5 Q