3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array( "0" => "red", "1" => "green" , "2" => "red" , "3" => "blue", "4" => "blue", "5" => "blue" ); $group_by_data = array_count_values($a); $keys = []; foreach($a as $key => $color){ if($group_by_data[$color] > 1){ if(!isset($keys[$color])) $keys[$color] = []; $keys[$color][] = $key; } } print_r($keys);

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.4.130.0120.00617.69
8.4.120.0090.01220.52
8.4.110.0100.01122.37
8.4.100.0150.00617.85
8.4.90.0110.01018.62
8.4.80.0050.00417.72
8.4.70.0130.00718.00
8.4.60.0160.00618.80
8.4.50.0080.01118.67
8.4.40.0050.00517.89
8.4.30.0040.01420.51
8.4.20.0140.00718.98
8.4.10.0030.00517.70
8.3.260.0060.00216.64
8.3.250.0120.00618.97
8.3.240.0110.00716.54
8.3.230.0100.00916.76
8.3.220.0110.00817.14
8.3.210.0080.00816.73
8.3.200.0040.00516.50
8.3.190.0060.00817.10
8.3.180.0050.00417.02
8.3.170.0050.00320.74
8.3.160.0130.00320.35
8.3.150.0090.00017.08
8.3.140.0060.00316.98
8.3.130.0160.00016.55
8.3.120.0040.00420.71
8.3.110.0090.00320.94
8.3.100.0080.00016.79
8.3.90.0040.00426.77
8.3.80.0090.00016.61
8.3.70.0110.00416.58
8.3.60.0060.00916.75
8.3.50.0130.00217.55
8.3.40.0150.00418.88
8.3.30.0070.00718.79
8.3.20.0040.00422.66
8.3.10.0040.00420.18
8.3.00.0000.00820.50
8.2.290.0080.00420.30
8.2.280.0030.00618.49
8.2.270.0110.00717.30
8.2.260.0030.01316.45
8.2.250.0120.00318.37
8.2.240.0070.00317.01
8.2.230.0060.01022.58
8.2.220.0040.00424.06
8.2.210.0120.00326.77
8.2.200.0130.00016.36
8.2.190.0120.00318.48
8.2.180.0130.00718.41
8.2.170.0110.00422.96
8.2.160.0070.00720.52
8.2.150.0050.00325.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0030.00521.20
8.2.110.0090.00020.60
8.2.100.0040.00717.91
8.2.90.0000.00817.75
8.2.80.0040.00418.16
8.2.70.0000.00817.93
8.2.60.0000.00818.22
8.2.50.0000.00818.10
8.2.40.0030.00619.47
8.2.30.0000.00719.24
8.2.20.0000.00818.13
8.2.10.0050.00219.32
8.2.00.0000.00719.32
8.1.330.0070.01222.00
8.1.320.0080.01116.37
8.1.310.0000.00918.50
8.1.300.0180.00017.95
8.1.290.0090.00030.84
8.1.280.0180.00425.92
8.1.270.0000.00820.81
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00322.05
8.1.230.0040.00822.08
8.1.220.0000.00817.76
8.1.210.0000.00818.77
8.1.200.0100.00017.35
8.1.190.0080.00017.35
8.1.180.0050.00318.10
8.1.170.0080.00020.84
8.1.160.0040.00418.91
8.1.150.0070.00018.88
8.1.140.0070.00020.15
8.1.130.0070.00321.88
8.1.120.0030.00817.31
8.1.110.0000.00717.36
8.1.100.0030.00517.35
8.1.90.0040.00417.48
8.1.80.0000.00817.37
8.1.70.0000.00717.51
8.1.60.0050.00317.57
8.1.50.0040.00417.57
8.1.40.0030.00517.55
8.1.30.0040.00417.55
8.1.20.0000.00817.55
8.1.10.0080.00017.57
8.1.00.0000.00717.42
8.0.300.0000.00819.59
8.0.290.0040.00416.75
8.0.280.0040.00418.37
8.0.270.0000.00816.88
8.0.260.0030.00320.08
8.0.250.0100.00016.94
8.0.240.0000.00616.88
8.0.230.0030.00316.95
8.0.220.0040.00416.77
8.0.210.0000.00816.86
8.0.200.0030.00316.96
8.0.190.0000.00716.82
8.0.180.0050.00316.94
8.0.170.0060.00316.80
8.0.160.0040.00416.96
8.0.150.0000.00816.76
8.0.140.0000.00716.89
8.0.130.0000.00513.32
8.0.120.0000.00816.85
8.0.110.0000.00716.86
8.0.100.0040.00416.76
8.0.90.0060.00316.93
8.0.80.0060.00916.96
8.0.70.0080.00016.79
8.0.60.0020.00516.79
8.0.50.0040.00416.89
8.0.30.0090.00916.99
8.0.20.0070.01117.01
8.0.10.0050.00316.98
8.0.00.0040.01616.76
7.4.330.0030.00315.55
7.4.320.0060.00316.51
7.4.300.0000.00616.56
7.4.290.0090.00316.59
7.4.280.0000.00716.65
7.4.270.0030.00316.51
7.4.260.0060.00013.40
7.4.250.0070.00016.46
7.4.240.0050.00216.53
7.4.230.0000.00716.60
7.4.220.0040.00416.52
7.4.210.0060.01016.61
7.4.200.0000.00816.39
7.4.130.0120.00616.42
7.4.120.0190.00016.38
7.4.110.0130.00716.48
7.4.100.0000.02316.40
7.4.90.0090.00916.45
7.4.80.0120.00419.39
7.4.70.0090.00616.48
7.4.60.0170.00616.36
7.4.50.0030.01016.37
7.4.40.0100.00716.54
7.4.00.0080.00814.78
7.3.330.0070.00016.11
7.3.320.0060.00013.31
7.3.310.0000.00716.36
7.3.300.0030.00316.33
7.3.290.0070.00016.32
7.3.280.0110.00516.28
7.3.260.0100.00916.42
7.3.240.0130.00616.44
7.3.230.0060.01216.45
7.3.210.0150.00316.55
7.3.200.0070.01016.56
7.3.190.0070.01016.36
7.3.180.0060.01616.38
7.3.170.0080.00916.55
7.3.160.0060.00916.30
7.3.120.0060.01214.82
7.3.110.0030.01314.82
7.3.100.0100.00615.06
7.3.90.0060.01114.91
7.3.80.0060.00914.98
7.3.70.0060.01014.87
7.3.60.0070.00514.75
7.3.50.0080.00614.67
7.3.40.0070.00414.82
7.3.30.0020.01214.68
7.3.20.0080.00515.62
7.3.10.0050.00715.79
7.3.00.0050.00715.68
7.2.330.0030.01416.80
7.2.320.0100.01016.65
7.2.310.0100.00716.78
7.2.300.0160.00616.86
7.2.290.0110.01116.59
7.2.250.0090.00914.77
7.2.240.0070.00715.05
7.2.230.0050.01315.07
7.2.220.0090.00515.29
7.2.210.0040.01314.92
7.2.200.0090.00514.95
7.2.190.0090.00415.11
7.2.180.0060.01015.06
7.2.170.0080.00515.14
7.2.160.0030.01214.80
7.2.150.0040.01215.08
7.2.140.0050.01014.75
7.2.130.0090.00615.11
7.2.120.0030.01415.17
7.2.110.0150.00714.99
7.2.100.0090.01215.11
7.2.90.0120.00614.94
7.2.80.0090.00915.04
7.2.70.0150.00714.88
7.2.60.0150.00815.25
7.2.50.0090.01014.82
7.2.40.0000.01615.12
7.2.30.0180.01115.21
7.2.20.0130.00815.23
7.2.10.0090.00615.07
7.2.00.0060.00915.08
7.1.330.0030.01015.99
7.1.320.0030.00814.90
7.1.310.0110.00814.74
7.1.300.0060.00914.87
7.1.290.0100.00614.87
7.1.280.0100.00214.84
7.1.270.0050.00914.84
7.1.260.0060.00614.97
7.1.250.0090.00613.85

preferences:
27.89 ms | 403 KiB | 5 Q