3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array ('1' => (object)array( 'id' => 225, 'user_id' => 1, 'name' => 'Blue Quilted Leather Jacket by Minusey - $499' ), '2' => (object)array( 'id' => 222, 'user_id' => 1, 'name' => 'Darling New Bathtub by Duravit - $6300' ), '3' => (object)array( 'id' => 222, 'user_id' => 1, 'name' => 'Darling New Bathtub by Duravit - $6300' ) ); //print_r(array_column((array)$array, 'id')); function array_unique_by_key($array, $key = 'id') { $found = array(); // Encountered IDs $out = array(); // Output array foreach ($array as $value) { if (!array_key_exists($key, $value)) throw new Exception('Can\'t find key "' . $key . '"'); $id = $value[$key]; // If already encountered, skip if (in_array($id, $found)) continue; // Otherwise, add to found values and to output array $found[] = $id; $out[] = $value; } return $out; } print_r(array_unique_by_key($array));

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.0110.00418.55
8.3.50.0080.00921.98
8.3.40.0150.00418.92
8.3.30.0060.00918.92
8.3.20.0040.00420.21
8.3.10.0050.00321.72
8.3.00.0000.00817.80
8.2.180.0120.00416.50
8.2.170.0040.01122.96
8.2.160.0070.00720.39
8.2.150.0000.00824.18
8.2.140.0070.00724.66
8.2.130.0050.00326.16
8.2.120.0000.00821.04
8.2.110.0040.00422.20
8.2.100.0110.00018.03
8.2.90.0040.00419.40
8.2.80.0000.00817.97
8.2.70.0000.00817.88
8.2.60.0060.00317.93
8.2.50.0040.00418.07
8.2.40.0000.00818.16
8.2.30.0000.00718.30
8.2.20.0000.00717.77
8.2.10.0040.00417.99
8.2.00.0050.00317.69
8.1.280.0040.01125.92
8.1.270.0000.00823.77
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00623.75
8.1.230.0070.00419.10
8.1.220.0000.00717.79
8.1.210.0040.00418.77
8.1.200.0030.00617.13
8.1.190.0040.00417.38
8.1.180.0030.00518.10
8.1.170.0090.00018.55
8.1.160.0030.00622.01
8.1.150.0000.00718.87
8.1.140.0060.00317.45
8.1.130.0000.00717.74
8.1.120.0000.00717.48
8.1.110.0030.00517.33
8.1.100.0040.00417.47
8.1.90.0030.00317.36
8.1.80.0040.00417.43
8.1.70.0000.00717.43
8.1.60.0000.00817.57
8.1.50.0040.00417.46
8.1.40.0060.00317.48
8.1.30.0000.00817.67
8.1.20.0000.00817.54
8.1.10.0070.00017.58
8.1.00.0000.00717.39
8.0.300.0060.00318.77
8.0.290.0000.00716.63
8.0.280.0030.00318.34
8.0.270.0000.00817.26
8.0.260.0060.00017.30
8.0.250.0000.00716.91
8.0.240.0070.00016.98
8.0.230.0040.00416.91
8.0.220.0080.00016.95
8.0.210.0000.00716.93
8.0.200.0000.00817.07
8.0.190.0000.00716.98
8.0.180.0050.00317.03
8.0.170.0040.00416.95
8.0.160.0000.00716.90
8.0.150.0040.00416.89
8.0.140.0050.00216.96
8.0.130.0030.00313.37
8.0.120.0050.00316.82
8.0.110.0040.00416.86
8.0.100.0080.00016.98
8.0.90.0000.00716.73
8.0.80.0110.00416.99
8.0.70.0070.00016.93
8.0.60.0000.00716.91
8.0.50.0040.00416.79
8.0.30.0140.01017.19
8.0.20.0120.00617.40
8.0.10.0000.00717.09
8.0.00.0080.01016.73
7.4.330.0030.00315.19
7.4.320.0060.00016.59
7.4.300.0030.00316.57
7.4.290.0040.00416.48
7.4.280.0000.00816.59
7.4.270.0000.00716.66
7.4.260.0030.00616.59
7.4.250.0100.00016.45
7.4.240.0020.00516.51
7.4.230.0030.00316.55
7.4.220.0030.01416.50
7.4.210.0040.01116.37
7.4.200.0080.00016.25
7.4.160.0040.01216.51
7.4.150.0110.00617.40
7.4.140.0110.00717.86
7.4.130.0090.00816.51
7.4.120.0110.00516.54
7.4.110.0210.00016.61
7.4.100.0160.00316.48
7.4.90.0100.01316.45
7.4.80.0050.01419.39
7.4.70.0050.01216.74
7.4.60.0100.00716.50
7.4.50.0020.00216.20
7.4.40.0090.00916.71
7.4.30.0030.01416.42
7.4.10.0100.00714.89
7.4.00.0060.01114.88
7.3.330.0000.00513.22
7.3.320.0020.00213.27
7.3.310.0000.00716.21
7.3.300.0030.00316.21
7.3.290.0110.00916.33
7.3.280.0080.01016.33
7.3.270.0090.00917.40
7.3.260.0080.01116.41
7.3.250.0120.00516.39
7.3.240.0110.00516.48
7.3.230.0170.00016.39
7.3.210.0140.00316.66
7.3.200.0060.01019.39
7.3.190.0030.01716.64
7.3.180.0030.01716.30
7.3.170.0070.01416.37
7.3.160.0090.00616.43
7.3.130.0140.00014.84
7.3.120.0050.01014.99
7.3.110.0060.01215.05
7.3.100.0080.00415.07
7.3.90.0030.01014.86
7.3.80.0030.01014.57
7.3.70.0080.00014.93
7.3.60.0060.00314.93
7.3.50.0070.00714.62
7.3.40.0000.00814.84
7.3.30.0030.01014.98
7.3.20.0040.00816.71
7.3.10.0000.01216.71
7.3.00.0000.01316.61
7.2.330.0100.00716.85
7.2.320.0070.01016.67
7.2.310.0070.01416.68
7.2.300.0060.01116.57
7.2.290.0070.01716.68
7.2.260.0070.01014.90
7.2.250.0110.00714.88
7.2.240.0070.00715.26
7.2.230.0060.00314.99
7.2.220.0030.00614.99
7.2.210.0000.01315.29
7.2.200.0030.00715.00
7.2.190.0040.00814.85
7.2.180.0040.01114.97
7.2.170.0070.01115.21
7.2.160.0040.01214.65
7.2.150.0000.01017.05
7.2.140.0040.01116.89
7.2.130.0000.01617.16
7.2.120.0080.00417.00
7.2.110.0180.00616.84
7.2.100.0130.00016.85
7.2.90.0000.01316.75
7.2.80.0060.00817.08
7.2.70.0070.00717.12
7.2.60.0070.00517.04
7.2.50.0060.00317.06
7.2.40.0100.00617.09
7.2.30.0070.00716.98
7.2.20.0000.01416.91
7.2.10.0030.01217.06
7.2.00.0080.00818.08
7.1.330.0100.00316.00
7.1.320.0070.01015.45
7.1.310.0000.01115.89
7.1.300.0060.00615.47
7.1.290.0030.00915.59
7.1.280.0070.00715.84
7.1.270.0040.00815.74
7.1.260.0030.01015.55
7.1.250.0000.01015.74
7.1.240.0100.00315.80
7.1.230.0090.00015.84
7.1.220.0040.00415.70
7.1.210.0070.00415.79
7.1.200.0030.01215.91
7.1.190.0070.01015.76
7.1.180.0040.00415.62
7.1.170.0030.00915.95
7.1.160.0040.00815.73
7.1.150.0040.00815.98
7.1.140.0030.01015.87
7.1.130.0060.00315.86
7.1.120.0000.01215.61
7.1.110.0090.00615.92
7.1.100.0070.00616.96
7.1.90.0040.00715.86
7.1.80.0030.01015.96
7.1.70.0040.00616.50
7.1.60.0110.00517.57
7.1.50.0050.01416.20
7.1.40.0030.01415.87
7.1.30.0040.00715.65
7.1.20.0030.01015.88
7.1.10.0040.01115.86
7.1.00.0100.03819.19
7.0.330.0040.00415.41
7.0.320.0030.00615.26
7.0.310.0000.01415.43
7.0.300.0060.00615.23
7.0.290.0050.00515.41
7.0.280.0040.01115.23
7.0.270.0060.00315.60
7.0.260.0070.00615.39
7.0.250.0090.00615.33
7.0.240.0060.00615.22
7.0.230.0040.00715.46
7.0.220.0130.00015.23
7.0.210.0060.00615.46
7.0.200.0030.00916.18
7.0.190.0030.00915.57
7.0.180.0070.00415.13
7.0.170.0000.01115.60
7.0.160.0000.01315.59
7.0.150.0030.01215.54
7.0.140.0110.03518.75
7.0.130.0060.00615.52
7.0.120.0090.00315.50
7.0.110.0040.00815.50
7.0.100.0030.01015.52
7.0.90.0030.00515.42
7.0.80.0040.00415.27
7.0.70.0030.01015.63
7.0.60.0020.04217.70
7.0.50.0090.03816.69
7.0.40.0040.04216.72
7.0.30.0250.02916.79
7.0.20.0120.02316.79
7.0.10.0070.03716.90
7.0.00.0060.03816.77
5.6.400.0070.00314.44
5.6.390.0070.00714.33
5.6.380.0100.00314.45
5.6.370.0040.01514.41
5.6.360.0040.00713.97
5.6.350.0000.01414.40
5.6.340.0000.01314.17
5.6.330.0000.01414.09
5.6.320.0040.01114.46
5.6.310.0040.01214.72
5.6.300.0070.01114.63
5.6.290.0090.00914.32
5.6.280.0060.03617.75
5.6.270.0070.00714.36
5.6.260.0090.00314.24
5.6.250.0030.01014.46
5.6.240.0050.00814.30
5.6.230.0040.00814.49
5.6.220.0030.00914.19
5.6.210.0070.04517.68
5.6.200.0050.02216.29
5.6.190.0060.02917.35
5.6.180.1970.02117.54
5.6.170.0160.03017.34
5.6.160.0080.02717.32
5.6.150.0020.02916.24
5.6.140.0060.04516.40
5.6.130.0100.04016.24
5.6.120.0060.03917.62
5.6.110.0030.03617.65
5.6.100.0050.03117.71
5.6.90.0050.03617.68
5.6.80.0060.04117.34
5.6.70.2040.01617.27
5.6.60.0030.00614.26
5.6.50.0070.00714.50
5.6.40.0070.00714.05
5.6.30.0030.00714.35
5.6.20.0080.00414.32
5.6.10.0030.01014.35
5.6.00.0160.00014.26
5.5.380.0060.00314.43
5.5.370.0000.00814.32
5.5.360.0030.00914.05
5.5.350.0120.03617.32
5.5.340.0120.03416.10
5.5.330.0050.02517.22
5.5.320.1580.02617.47
5.5.310.0180.03917.38
5.5.300.0030.05016.22
5.5.290.0050.03716.05
5.5.280.0060.04717.59
5.5.270.0030.02817.52
5.5.260.0070.05117.55
5.5.250.0060.04817.60
5.5.240.0150.03517.30
5.5.230.0110.00314.43
5.5.220.0030.01314.32
5.5.210.0090.00614.30
5.5.200.0000.01414.19
5.5.190.0000.01114.19
5.5.180.0000.01214.23
5.5.170.0100.00314.29
5.5.160.0000.00914.22
5.5.150.0030.01014.64
5.5.140.0070.00714.52
5.5.130.0070.00714.18
5.5.120.0030.01013.99
5.5.110.0000.01314.20
5.5.100.0000.00914.08
5.5.90.0120.00014.03
5.5.80.0050.00513.96
5.5.70.0070.00714.25
5.5.60.0030.00614.13
5.5.50.0030.00814.21
5.5.40.0040.00714.39
5.5.30.0090.00314.50
5.5.20.0090.00314.04
5.5.10.0080.00014.26
5.5.00.0050.00314.34
5.4.450.0030.03615.93
5.4.440.0150.02916.01
5.4.430.0150.02515.97
5.4.420.0050.03515.98
5.4.410.0050.03115.65
5.4.400.0200.02715.62
5.4.390.0250.03415.50
5.4.380.0100.03115.53
5.4.370.0100.02815.50
5.4.360.0130.02515.45
5.4.350.0070.02412.20
5.4.340.0040.02412.20
5.4.330.0040.00712.39
5.4.320.0020.02212.44
5.4.310.0070.01812.44
5.4.300.0050.02112.45
5.4.290.0060.02112.45
5.4.280.0060.02112.39
5.4.270.0060.02012.39
5.4.260.0040.02112.39
5.4.250.0030.02512.39
5.4.240.0080.02512.39
5.4.230.0050.02312.39
5.4.220.0050.02012.39
5.4.210.0050.02712.39
5.4.200.0050.02112.39
5.4.190.0060.02112.39
5.4.180.0070.02012.39
5.4.170.0060.02212.39
5.4.160.0020.02212.39
5.4.150.0030.02312.38
5.4.140.0070.01912.23
5.4.130.0070.01912.22
5.4.120.0080.01812.20
5.4.110.0060.02212.20
5.4.100.0080.01812.20
5.4.90.0010.02412.20
5.4.80.0020.02412.20
5.4.70.0060.01612.20
5.4.60.0080.01712.20
5.4.50.0080.01912.20
5.4.40.0050.02112.19
5.4.30.0060.02212.19
5.4.20.0140.02512.19
5.4.10.0060.02412.19
5.4.00.0020.02311.94
5.3.290.0020.02412.59
5.3.280.0040.02212.55
5.3.270.0020.02512.55
5.3.260.0040.02412.55
5.3.250.0040.02712.55
5.3.240.0040.02012.55
5.3.230.0030.02412.55
5.3.220.0050.01912.53
5.3.210.0030.02612.53
5.3.200.0060.02512.54
5.3.190.0040.02612.53
5.3.180.0090.02012.53
5.3.170.0080.02412.53
5.3.160.0030.02512.53
5.3.150.0060.02012.53
5.3.140.0060.01912.52
5.3.130.0020.02612.52
5.3.120.0030.02312.52
5.3.110.0070.02012.52
5.3.100.0040.02312.26
5.3.90.0050.02012.25
5.3.80.0020.02512.24
5.3.70.0100.02012.24
5.3.60.0040.02112.23
5.3.50.0020.02212.21
5.3.40.0050.02112.21
5.3.30.0080.01812.19
5.3.20.0050.02412.08
5.3.10.0020.02312.06
5.3.00.0060.02112.05
5.2.170.0100.0339.23
5.2.160.0060.0289.22
5.2.150.0030.0329.22
5.2.140.0060.0309.22
5.2.130.0030.0309.18
5.2.120.0070.0299.18
5.2.110.0070.0389.19
5.2.100.0110.0329.18
5.2.90.0030.0309.18
5.2.80.0080.0289.17
5.2.70.0090.0329.18
5.2.60.0010.0349.14
5.2.50.0070.0279.11
5.2.40.0040.0309.08
5.2.30.0020.0329.05
5.2.20.0050.0289.04
5.2.10.0070.0258.95
5.2.00.0050.0288.81
5.1.60.0050.0238.10
5.1.50.0010.0288.09
5.1.40.0040.0258.07
5.1.30.0050.0258.42
5.1.20.0040.0288.45
5.1.10.0040.0288.17
5.1.00.0050.0268.17
5.0.50.0060.0196.65
5.0.40.0020.0216.51
5.0.30.0040.0316.32
5.0.20.0040.0196.28
5.0.10.0040.0206.27
5.0.00.0040.0306.26
4.4.90.0020.0164.78
4.4.80.0030.0154.76
4.4.70.0010.0174.76
4.4.60.0010.0174.75
4.4.50.0010.0174.77
4.4.40.0040.0244.71
4.4.30.0020.0164.76
4.4.20.0020.0164.84
4.4.10.0010.0204.84
4.4.00.0030.0264.76
4.3.110.0040.0154.67
4.3.100.0040.0234.67
4.3.90.0050.0184.63
4.3.80.0050.0294.59
4.3.70.0010.0164.63
4.3.60.0040.0134.63
4.3.50.0020.0164.63
4.3.40.0010.0294.54
4.3.30.0040.0153.30
4.3.20.0030.0153.28
4.3.10.0040.0143.24
4.3.00.0000.0277.02

preferences:
38.08 ms | 401 KiB | 5 Q