3v4l.org

run code in 300+ PHP versions simultaneously
<?php $title = ['gold','blue night','silver morning','about earth','sun vs king','blue night','about earth','gold','about earth']; $value_counts = array_count_values($title); #print_r($value_counts); $expected_result = []; foreach($value_counts as $k=>$v){ if($v<2){ $expected_result[] = $k; }else{ $expected_result[] = $k; for($i=2;$i<=$v;$i++){ $expected_result[] = $k."-".$i; } } } print_r($expected_result);

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.130.0050.00316.56
8.3.120.0000.00820.66
8.3.110.0090.00620.94
8.3.100.0090.00024.06
8.3.90.0120.00326.77
8.3.80.0060.00317.97
8.3.70.0140.00718.30
8.3.60.0100.01318.52
8.3.50.0120.00318.00
8.3.40.0170.00018.42
8.3.30.0070.00718.47
8.3.20.0080.00018.78
8.3.10.0030.00621.77
8.3.00.0030.00520.55
8.2.250.0080.00018.54
8.2.240.0080.00416.88
8.2.230.0070.00322.58
8.2.220.0100.00737.54
8.2.210.0120.00626.77
8.2.200.0100.00018.30
8.2.190.0040.01116.58
8.2.180.0140.00018.42
8.2.170.0070.01122.96
8.2.160.0140.00419.05
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0080.00019.89
8.2.120.0000.00826.35
8.2.110.0070.00320.22
8.2.100.0130.00318.03
8.2.90.0050.00317.84
8.2.80.0030.00517.97
8.2.70.0050.00318.05
8.2.60.0000.00818.02
8.2.50.0040.00418.10
8.2.40.0040.00419.21
8.2.30.0040.00419.18
8.2.20.0030.00718.02
8.2.10.0000.00718.03
8.2.00.0040.00417.64
8.1.300.0000.00718.35
8.1.290.0090.00030.84
8.1.280.0100.00725.92
8.1.270.0040.00419.01
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0090.00022.55
8.1.230.0040.00720.96
8.1.220.0000.00817.78
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0050.00317.23
8.1.180.0000.00918.10
8.1.170.0000.00818.51
8.1.160.0040.00418.75
8.1.150.0000.00718.92
8.1.140.0000.00722.12
8.1.130.0000.00720.04
8.1.120.0070.00017.51
8.1.110.0040.00417.41
8.1.100.0070.00017.43
8.1.90.0030.00317.35
8.1.80.0000.00817.41
8.1.70.0040.00417.33
8.1.60.0050.00517.56
8.1.50.0050.00517.49
8.1.40.0040.00417.40
8.1.30.0070.00017.63
8.1.20.0040.00417.64
8.1.10.0050.00317.49
8.1.00.0060.00617.41
8.0.300.0000.00719.69
8.0.290.0050.00516.63
8.0.280.0050.00318.44
8.0.270.0050.00217.10
8.0.260.0000.00818.30
8.0.250.0030.00316.99
8.0.240.0030.00316.93
8.0.230.0000.00616.86
8.0.220.0030.00616.94
8.0.210.0000.00716.80
8.0.200.0040.00416.85
8.0.190.0060.00316.93
8.0.180.0000.00716.79
8.0.170.0050.00316.76
8.0.160.0040.00416.88
8.0.150.0000.00716.81
8.0.140.0000.00716.82
8.0.130.0070.00313.35
8.0.120.0060.00316.95
8.0.110.0040.00416.73
8.0.100.0040.00416.68
8.0.90.0030.00616.86
8.0.80.0070.00816.85
8.0.70.0030.00516.75
8.0.60.0040.00416.84
8.0.50.0030.00316.84
8.0.30.0100.00716.96
8.0.20.0100.01017.40
8.0.10.0070.00016.83
8.0.00.0090.01416.97
7.4.330.0050.00015.55
7.4.320.0030.00316.50
7.4.300.0030.00316.48
7.4.290.0070.00016.61
7.4.280.0050.00216.59
7.4.270.0030.00316.43
7.4.260.0070.00016.57
7.4.250.0040.00416.60
7.4.240.0030.00316.51
7.4.230.0000.00716.31
7.4.220.0060.00316.64
7.4.210.0090.00816.63
7.4.200.0000.00716.57
7.4.160.0120.00616.51
7.4.140.0090.00817.86
7.4.130.0110.00716.34
7.4.120.0130.00616.54
7.4.110.0090.01416.45
7.4.100.0050.01616.40
7.4.90.0030.01416.50
7.4.80.0110.01119.39
7.4.70.0110.01016.34
7.4.60.0030.01316.45
7.4.50.0110.00716.58
7.4.40.0080.00816.37
7.4.00.0060.00914.80
7.3.330.0000.00612.93
7.3.320.0030.00312.99
7.3.310.0040.00416.34
7.3.300.0000.00616.09
7.3.290.0070.00016.23
7.3.280.0030.01316.20
7.3.260.0110.01016.37
7.3.240.0090.01016.48
7.3.230.0160.00016.28
7.3.210.0110.01116.27
7.3.200.0140.00316.34
7.3.190.0070.01016.19
7.3.180.0060.00916.46
7.3.170.0100.01016.38
7.3.160.0060.01616.49
7.3.10.0110.00416.60
7.3.00.0060.00916.66
7.2.330.0140.00716.69
7.2.320.0100.01016.77
7.2.310.0090.01216.75
7.2.300.0120.00916.58
7.2.290.0120.00616.82
7.2.130.0070.01116.98
7.2.120.0060.00616.80
7.2.110.0130.00415.98
7.2.100.0180.00915.76
7.2.90.0140.00915.78
7.2.80.0110.00815.74
7.2.70.0150.00415.79
7.2.60.0120.00715.84
7.2.50.0140.00916.08
7.2.40.0610.00615.92
7.2.30.0160.00615.87
7.2.20.0210.00615.74
7.2.10.0120.00216.09
7.2.00.0030.00916.06
7.1.250.0000.01415.81
7.1.230.0110.00713.83
7.1.220.0220.00013.90
7.1.210.0180.00313.91
7.1.200.0190.00913.93
7.1.190.0160.00913.70
7.1.180.0170.01313.89
7.1.170.0220.00613.61
7.1.160.0200.01413.70
7.1.150.0230.00714.11
7.1.140.0210.00913.59
7.1.130.0080.01213.61
7.1.120.0110.01113.57
7.1.110.0200.00313.89
7.1.100.0090.00614.06
7.1.90.0170.00313.89
7.1.80.0110.00613.72
7.1.70.0140.00713.92
7.1.60.0410.00731.77
7.1.50.0380.00431.87
7.1.40.0250.00931.96
7.1.30.0320.00931.92
7.1.20.0740.01331.96
7.1.10.0170.00314.05
7.1.00.0250.00413.99
5.6.380.0000.01114.11

preferences:
27.13 ms | 403 KiB | 5 Q