3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array('title1','title2','title2','title3','title4','title5','title5','title6','title6','title5'); sort($array); $unique_length = count( array_unique($array) ); $total_dupes = 0; $clean = array(); for ($i=0; $i<$unique_length; $i++) { $current = array_shift($array); if ($current === NULL)//already have all elements break; $found = 1; while (($key = array_search($current, $array)) !== FALSE) {//search for dupes $found++; unset($array[$key]); } if ($found == 1) array_push($clean, $current); else { $dupes = array(); for ($i=0; $i<$found; $i++) $dupes[] = $current; $total_dupes++; $clean['dupe'.$total_dupes] = $dupes; } } print_r($clean);

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.40.0140.00018.85
8.3.30.0110.00319.04
8.3.20.0070.00020.22
8.3.10.0050.00321.90
8.3.00.0060.00322.34
8.2.170.0140.00718.89
8.2.160.0100.00322.96
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0100.01026.16
8.2.120.0000.00822.28
8.2.110.0110.00021.04
8.2.100.0110.00017.72
8.2.90.0030.00619.21
8.2.80.0030.00517.97
8.2.70.0050.00317.63
8.2.60.0050.00318.05
8.2.50.0050.00318.07
8.2.40.0050.00319.28
8.2.30.0030.00618.16
8.2.20.0000.00817.71
8.2.10.0040.00417.76
8.2.00.0000.00817.68
8.1.270.0090.00023.83
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00323.79
8.1.230.0040.00817.70
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0030.00617.52
8.1.180.0000.00818.10
8.1.170.0080.00018.64
8.1.160.0030.00522.03
8.1.150.0000.00718.65
8.1.140.0000.00717.34
8.1.130.0000.00717.73
8.1.120.0040.00417.51
8.1.110.0000.00817.38
8.1.100.0030.00517.36
8.1.90.0040.00417.51
8.1.80.0080.00017.49
8.1.70.0030.00317.27
8.1.60.0000.00817.55
8.1.50.0040.00417.43
8.1.40.0040.00417.53
8.1.30.0000.00817.65
8.1.20.0040.00417.67
8.1.10.0040.00417.47
8.1.00.0030.00517.51
8.0.300.0070.00018.77
8.0.290.0060.00317.17
8.0.280.0000.00718.38
8.0.270.0050.00317.30
8.0.260.0000.00616.88
8.0.250.0030.00317.02
8.0.240.0000.00716.98
8.0.230.0070.00016.91
8.0.220.0050.00216.84
8.0.210.0030.00316.95
8.0.200.0000.00816.95
8.0.190.0040.00416.96
8.0.180.0000.00716.88
8.0.170.0000.00816.83
8.0.160.0000.00816.82
8.0.150.0000.00816.96
8.0.140.0070.00016.86
8.0.130.0030.00313.31
8.0.120.0080.00016.89
8.0.110.0040.00416.89
8.0.100.0000.00716.80
8.0.90.0000.00716.80
8.0.80.0100.00716.94
8.0.70.0000.00716.81
8.0.60.0040.00417.01
8.0.50.0040.00416.78
8.0.30.0130.00916.92
8.0.20.0150.00517.40
8.0.10.0000.00816.83
8.0.00.0070.01216.71
7.4.330.0050.00015.02
7.4.320.0000.00616.62
7.4.300.0000.00616.52
7.4.290.0000.00716.64
7.4.280.0000.00716.60
7.4.270.0000.00716.50
7.4.260.0000.00716.46
7.4.250.0070.00016.59
7.4.240.0000.00816.48
7.4.230.0070.00016.59
7.4.220.0090.00916.54
7.4.210.0030.01316.56
7.4.200.0000.00816.36
7.4.190.0040.00416.75
7.4.160.0030.01316.50
7.4.150.0130.01017.40
7.4.140.0100.00717.86
7.4.130.0110.00716.58
7.4.120.0070.01016.39
7.4.110.0100.00716.49
7.4.100.0100.00616.53
7.4.90.0090.00616.42
7.4.80.0130.01119.39
7.4.70.0110.00516.54
7.4.60.0120.00816.54
7.4.50.0000.00816.36
7.4.40.0110.00322.77
7.4.30.0030.01216.46
7.4.10.0060.01214.93
7.4.00.0060.00914.91
7.3.330.0050.00013.20
7.3.320.0030.00313.25
7.3.310.0030.00316.39
7.3.300.0070.00016.35
7.3.290.0090.00516.34
7.3.280.0090.00916.33
7.3.270.0090.01017.40
7.3.260.0110.00616.40
7.3.250.0100.00716.41
7.3.240.0030.01316.49
7.3.230.0090.01516.59
7.3.210.0070.01016.49
7.3.200.0090.00619.39
7.3.190.0140.00316.40
7.3.180.0130.00316.46
7.3.170.0110.00416.35
7.3.160.0110.00716.33
7.3.130.0090.00914.91
7.3.120.0100.00714.94
7.3.110.0060.00914.68
7.3.100.0130.00014.83
7.3.90.0040.00715.02
7.3.80.0150.00014.80
7.3.70.0070.01114.93
7.3.60.0100.00314.81
7.3.50.0120.00314.80
7.3.40.0060.01014.79
7.3.30.0030.00714.98
7.3.20.0100.00616.48
7.3.10.0120.00316.65
7.3.00.0030.00616.82
7.2.330.0120.00616.59
7.2.320.0120.01116.38
7.2.310.0100.01316.45
7.2.300.0140.00616.66
7.2.290.0110.00716.46
7.2.260.0070.01014.79
7.2.250.0090.00915.10
7.2.240.0030.01315.07
7.2.230.0060.00814.90
7.2.220.0090.00614.85
7.2.210.0090.00615.19
7.2.200.0090.00615.17
7.2.190.0040.01114.88
7.2.180.0040.01115.01
7.2.170.0060.00915.07
7.2.160.0000.01015.09
7.2.150.0060.01217.01
7.2.140.0000.01416.84
7.2.130.0040.01117.03
7.2.120.0120.00616.75
7.2.110.0070.01016.71
7.2.100.0070.01116.93
7.2.90.0110.00716.74
7.2.80.0110.00616.62
7.2.70.0030.01317.07
7.2.60.0070.00516.84
7.2.50.0060.00616.71
7.2.40.0070.00316.92
7.2.30.0100.00316.92
7.2.20.0120.00316.92
7.2.10.0000.01416.60
7.2.00.0070.00718.09
7.1.330.0060.00915.61
7.1.320.0080.00815.65
7.1.310.0110.00715.72
7.1.300.0100.00315.79
7.1.290.0040.00715.69
7.1.280.0030.01015.98
7.1.270.0030.01215.49
7.1.260.0030.00915.56
7.1.250.0030.01015.99
7.1.240.0100.00715.71
7.1.230.0060.01016.00
7.1.220.0070.01015.84
7.1.210.0060.00615.63
7.1.200.0130.00615.96
7.1.190.0070.00715.87
7.1.180.0000.01515.98
7.1.170.0070.00315.64
7.1.160.0030.01015.81
7.1.150.0070.01015.98
7.1.140.0060.00615.97
7.1.130.0050.00315.77
7.1.120.0030.00915.96
7.1.110.0080.00015.94
7.1.100.0270.00416.97
7.1.90.0070.00715.96
7.1.80.0070.00716.04
7.1.70.0080.00316.34
7.1.60.0070.01217.61
7.1.50.0100.00616.26
7.1.40.0070.00315.72
7.1.30.0090.00015.75
7.1.20.0070.00715.83
7.1.10.0070.00715.95
7.1.00.0030.04119.03
7.0.330.0030.00815.18
7.0.320.0090.00615.22
7.0.310.0060.00615.30
7.0.300.0000.01415.55
7.0.290.0070.00715.41
7.0.280.0090.00615.55
7.0.270.0000.00915.46
7.0.260.0050.00315.27
7.0.250.0070.00415.21
7.0.240.0070.00715.48
7.0.230.0120.00315.45
7.0.220.0100.00315.51
7.0.210.0040.01115.58
7.0.200.0040.00916.22
7.0.190.0040.01015.50
7.0.180.0130.00015.50
7.0.170.0030.01015.50
7.0.160.0030.00815.59
7.0.150.0030.01415.38
7.0.140.0020.04018.65
7.0.130.0030.00715.27
7.0.120.0080.00815.41
7.0.110.0030.00915.38
7.0.100.0060.01015.24
7.0.90.0120.00315.61
7.0.80.0000.01615.57
7.0.70.0070.00715.32
7.0.60.0090.02517.60
7.0.50.0080.04316.61
7.0.40.0080.02016.82
7.0.30.0250.03916.78
7.0.20.0100.02916.89
7.0.10.0070.03016.92
7.0.00.0050.04516.80
5.6.400.0060.00614.25
5.6.390.0100.00314.58
5.6.380.0030.00714.65
5.6.370.0140.00014.00
5.6.360.0040.01114.35
5.6.350.0030.00714.58
5.6.340.0120.00314.32
5.6.330.0000.01114.84
5.6.320.0080.00414.55
5.6.310.0070.00714.45
5.6.300.0090.00614.33
5.6.290.0060.00614.77
5.6.280.0030.04317.68
5.6.270.0100.00614.21
5.6.260.0040.00714.79
5.6.250.0060.00614.39
5.6.240.0070.00314.52
5.6.230.0070.00714.65
5.6.220.0060.00614.73
5.6.210.0030.04517.54
5.6.200.0100.04116.23
5.6.190.0060.02517.54
5.6.180.0080.04117.54
5.6.170.0180.02017.32
5.6.160.0070.04017.50
5.6.150.0020.02716.23
5.6.140.0070.02316.35
5.6.130.0020.03716.26
5.6.120.0030.04917.69
5.6.110.0070.04517.67
5.6.100.0110.04017.71
5.6.90.0080.02117.78
5.6.80.0070.04517.36
5.6.70.0120.02717.35
5.6.60.0070.00714.66
5.6.50.0130.00314.36
5.6.40.0000.01414.37
5.6.30.0110.00414.25
5.6.20.0040.01114.19
5.6.10.0070.00714.33
5.6.00.0040.01414.27
5.5.380.0030.01214.06
5.5.370.0040.01114.55
5.5.360.0040.00714.50
5.5.350.0050.03517.43
5.5.340.0020.02616.12
5.5.330.0080.04317.40
5.5.320.0020.04517.39
5.5.310.0130.04817.39
5.5.300.0090.02216.23
5.5.290.0050.04816.29
5.5.280.0050.04917.52
5.5.270.0090.03117.64
5.5.260.0060.03317.68
5.5.250.0100.04317.43
5.5.240.0140.03417.14
5.5.230.0080.00814.37
5.5.220.0060.00914.24
5.5.210.0060.01314.38
5.5.200.0070.00314.47
5.5.190.0040.01114.17
5.5.180.0110.00414.37
5.5.170.0060.00614.40
5.5.160.0030.01014.30
5.5.150.0070.00714.51
5.5.140.0110.00314.24
5.5.130.0030.01314.39
5.5.120.0070.01014.32
5.5.110.0030.01214.55
5.5.100.0060.01014.00
5.5.90.0040.01114.21
5.5.80.0090.00614.19
5.5.70.0140.00014.52
5.5.60.0070.01114.16
5.5.50.0000.01414.47
5.5.40.0070.00714.36
5.5.30.0070.00714.31
5.5.20.0040.00414.21
5.5.10.0110.00413.98
5.5.00.0120.00314.27
5.4.450.0130.03915.87
5.4.440.0170.03015.82
5.4.430.0200.02515.80
5.4.420.0210.03515.88
5.4.410.0150.03215.82
5.4.400.0190.03615.64
5.4.390.0130.02615.76
5.4.380.0180.02815.73
5.4.370.0180.02015.80
5.4.360.0180.04015.71
5.4.350.0170.02515.64
5.4.340.0220.02115.76
5.4.330.0110.00312.30
5.4.320.0110.02315.71
5.4.310.0340.03315.57
5.4.300.0170.03515.77
5.4.290.0240.04315.69
5.4.280.0170.03915.80
5.4.270.0150.02515.75
5.4.260.0150.03815.74
5.4.250.0130.04315.72
5.4.240.0290.02315.76
5.4.230.0240.02915.77
5.4.220.0140.04215.71
5.4.210.0110.02515.75
5.4.200.0180.03515.68
5.4.190.0140.03615.75
5.4.180.0100.02815.74
5.4.170.0200.02715.75
5.4.160.0060.03615.63
5.4.150.0120.02515.57
5.4.140.0140.03314.32
5.4.130.0120.03514.38
5.4.120.0080.02914.40
5.4.110.0160.02014.33
5.4.100.0110.02114.28
5.4.90.0130.01914.37
5.4.80.0100.03314.37
5.4.70.0120.03214.41
5.4.60.0120.02514.36
5.4.50.0160.03114.40
5.4.40.0160.03614.32
5.4.30.0180.02214.36
5.4.20.0120.02514.36
5.4.10.0140.01914.37
5.4.00.0120.02214.13
5.3.290.0200.08014.57
5.3.280.0270.06314.51
5.3.270.0300.06714.62
5.3.260.0270.06314.52
5.3.250.0370.06314.58
5.3.240.0300.07314.70
5.3.230.0300.06314.68
5.3.220.0330.03714.66
5.3.210.0300.07314.48
5.3.200.0230.07014.69
5.3.190.0200.07314.48
5.3.180.0170.05714.54
5.3.170.0200.04014.46
5.3.160.0300.05714.46
5.3.150.0270.05314.49
5.3.140.0300.07014.53
5.3.130.0270.05314.78
5.3.120.0170.04714.52
5.3.110.0270.06714.54
5.3.100.0200.06013.95
5.3.90.0170.03713.92
5.3.80.0270.06314.10
5.3.70.0330.06313.95
5.3.60.0200.07013.91
5.3.50.0170.04014.10
5.3.40.0170.04013.96
5.3.30.0200.04713.96
5.3.20.0170.03713.71
5.3.10.0200.04313.55
5.3.00.0200.07313.65
5.2.170.0200.03011.32
5.2.160.0130.03011.07
5.2.150.0130.03011.16
5.2.140.0130.03011.08
5.2.130.0170.03711.09
5.2.120.0130.05711.07
5.2.110.0100.03311.08
5.2.100.0130.02711.07
5.2.90.0100.03011.04
5.2.80.0270.05011.00
5.2.70.0270.03011.06
5.2.60.0070.03310.97
5.2.50.0130.02710.93
5.2.40.0270.03311.05
5.2.30.0170.03011.02
5.2.20.0170.02310.92
5.2.10.0100.03710.94
5.2.00.0100.03710.73
5.1.60.0100.0379.99
5.1.50.0100.0439.86
5.1.40.0130.0409.87
5.1.30.0100.03710.27
5.1.20.0100.02710.29
5.1.10.0130.02310.00
5.1.00.0100.03710.06
5.0.50.0070.0208.71
5.0.40.0100.0208.35
5.0.30.0030.0478.22
5.0.20.0030.0208.43
5.0.10.0000.0238.22
5.0.00.0030.0338.22
4.4.90.0070.0138.22
4.4.80.0070.0208.22
4.4.70.0100.0208.22
4.4.60.0070.0138.22
4.4.50.0030.0178.22
4.4.40.0030.0278.22
4.4.30.0070.0138.22
4.4.20.0070.0138.22
4.4.10.0070.0208.22
4.4.00.0070.0238.22
4.3.110.0100.0178.22
4.3.100.0070.0138.22
4.3.90.0070.0338.22
4.3.80.0070.0408.22
4.3.70.0070.0178.22
4.3.60.0030.0238.22
4.3.50.0070.0178.22
4.3.40.0070.0278.22
4.3.30.0030.0338.22
4.3.20.0000.0278.22
4.3.10.0030.0178.22
4.3.00.0030.0308.22

preferences:
44.58 ms | 400 KiB | 5 Q