3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rgData = array( 3 => 1, 5 => 0, 1 => 2, 9 => 0, 0 => 1, 4 => 2, 2 => 1, 7 => 0, 6 => 0, 8 => 0, ); $keys = array_keys($rgData); // Sort the array's keys usort($keys, function($a, $b) use($rgData){ $aVal = $rgData[$a]; $bVal = $rgData[$b]; // Compare the values if($aVal === $bVal){ // If they are the same, compare the keys return $a - $b; } // Otherwise compare the values return $aVal - $bVal; }); var_dump($rgData);

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.70.0110.01118.31
8.3.60.0110.01116.50
8.3.50.0120.00721.95
8.3.40.0100.01018.77
8.3.30.0070.00719.09
8.3.20.0000.00720.31
8.3.10.0040.00423.48
8.3.00.0040.00421.01
8.2.180.0070.01018.25
8.2.170.0070.00722.96
8.2.160.0070.01320.28
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0050.00222.06
8.2.110.0080.00022.20
8.2.100.0090.00317.91
8.2.90.0050.00319.34
8.2.80.0050.00317.97
8.2.70.0060.00317.50
8.2.60.0040.00417.93
8.2.50.0000.00918.07
8.2.40.0000.00920.07
8.2.30.0040.00418.20
8.2.20.0040.00417.63
8.2.10.0050.00318.04
8.2.00.0000.00717.70
8.1.280.0150.00625.92
8.1.270.0060.00322.19
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.99
8.1.230.0070.00419.15
8.1.220.0030.00617.74
8.1.210.0050.00318.77
8.1.200.0030.00717.48
8.1.190.0040.00417.23
8.1.180.0040.00419.13
8.1.170.0040.00418.64
8.1.160.0000.00722.05
8.1.150.0000.00818.68
8.1.140.0040.00417.35
8.1.130.0070.00017.81
8.1.120.0000.00717.30
8.1.110.0030.00617.46
8.1.100.0030.00317.47
8.1.90.0040.00417.35
8.1.80.0000.00717.45
8.1.70.0030.00517.36
8.1.60.0080.00017.45
8.1.50.0000.00817.51
8.1.40.0000.00817.35
8.1.30.0030.00517.66
8.1.20.0040.00417.56
8.1.10.0080.00017.59
8.1.00.0060.00317.56
8.0.300.0030.00618.77
8.0.290.0050.00317.04
8.0.280.0030.00318.49
8.0.270.0000.00717.15
8.0.260.0000.00617.15
8.0.250.0030.00316.92
8.0.240.0070.00016.82
8.0.230.0000.00716.79
8.0.220.0030.00316.91
8.0.210.0000.00716.82
8.0.200.0000.00816.91
8.0.190.0040.00416.91
8.0.180.0030.00516.86
8.0.170.0050.00316.80
8.0.160.0040.00416.88
8.0.150.0050.00216.81
8.0.140.0040.00416.67
8.0.130.0000.00613.30
8.0.120.0000.00816.75
8.0.110.0050.00316.82
8.0.100.0030.00516.91
8.0.90.0050.00316.70
8.0.80.0130.01016.80
8.0.70.0070.00016.94
8.0.60.0070.00016.84
8.0.50.0040.00416.90
8.0.30.0110.00817.11
8.0.20.0120.00517.40
8.0.10.0000.00816.98
8.0.00.0100.00816.84
7.4.330.0000.00615.00
7.4.320.0060.00016.49
7.4.300.0030.00516.57
7.4.290.0000.00816.63
7.4.280.0070.00416.50
7.4.270.0040.00416.58
7.4.260.0070.00016.57
7.4.250.0030.00516.48
7.4.240.0020.00516.50
7.4.230.0070.00016.50
7.4.220.0110.00616.60
7.4.210.0090.00516.54
7.4.200.0000.00716.24
7.4.190.0050.00216.66
7.4.160.0100.01316.25
7.4.150.0100.00717.40
7.4.140.0110.00617.86
7.4.130.0080.01116.50
7.4.120.0090.01116.47
7.4.110.0110.00716.46
7.4.100.0120.00616.55
7.4.90.0030.01316.68
7.4.80.0040.01519.39
7.4.70.0120.00616.52
7.4.60.0120.00616.38
7.4.50.0050.00016.50
7.4.40.0100.01016.44
7.4.30.0090.01316.37
7.4.00.0080.00815.05
7.3.330.0050.00013.36
7.3.320.0000.00513.16
7.3.310.0050.00316.21
7.3.300.0070.00016.40
7.3.290.0030.01016.25
7.3.280.0080.01116.31
7.3.270.0110.00617.40
7.3.260.0090.00916.49
7.3.250.0080.01016.27
7.3.240.0070.01016.46
7.3.230.0140.00516.63
7.3.210.0180.00016.34
7.3.200.0060.01619.39
7.3.190.0120.01116.36
7.3.180.0060.00916.31
7.3.170.0110.00716.36
7.3.160.0140.00316.46
7.3.120.0090.00615.00
7.3.10.0050.00516.60
7.3.00.0060.00316.71
7.2.330.0090.00916.57
7.2.320.0140.00716.74
7.2.310.0090.01216.71
7.2.300.0130.00316.79
7.2.290.0140.00316.51
7.2.130.0030.01016.89
7.2.120.0140.00316.85
7.2.110.0080.00316.68
7.2.100.0030.00816.84
7.2.90.0070.00716.86
7.2.80.0060.00616.89
7.2.70.0060.00617.13
7.2.60.0050.00516.96
7.2.50.0040.00816.91
7.2.40.0060.00316.80
7.2.30.0090.00616.75
7.2.20.0000.01516.88
7.2.10.0050.00517.19
7.2.00.0070.00417.07
7.1.250.0080.00415.76
7.1.70.0100.00317.36
7.1.60.0100.01319.46
7.1.50.0040.02416.91
7.1.00.0000.08022.37
7.0.200.0070.00016.70
7.0.140.0000.07321.96
7.0.70.0070.07321.66
7.0.60.0070.06721.65
7.0.50.0030.07322.01
7.0.40.0100.08020.07
7.0.30.0070.05720.11
7.0.20.0130.07720.10
7.0.10.0130.07720.18
7.0.00.0030.04020.02
5.6.220.0070.08020.68
5.6.210.0000.08720.67
5.6.200.0070.08721.00
5.6.190.0070.08021.04
5.6.180.0030.06721.05
5.6.170.0100.07721.13
5.6.160.0030.08721.08
5.6.150.0030.07020.96
5.6.140.0030.08321.05
5.6.130.0130.07721.10
5.6.120.0070.08021.04
5.6.110.0030.08721.03
5.6.100.0000.08021.04
5.6.90.0070.07321.15
5.6.80.0030.08020.56
5.6.70.0000.07020.39
5.6.60.0070.04720.50
5.6.50.0070.07720.57
5.6.40.0000.08020.43
5.6.30.0100.05320.39
5.6.20.0030.07320.49
5.6.10.0070.07720.52
5.6.00.0100.05320.39
5.5.360.0100.07020.41
5.5.350.0070.05020.43
5.5.340.0030.07020.83
5.5.330.0030.08320.93
5.5.320.0070.07720.84
5.5.310.0030.05020.64
5.5.300.0030.07020.80
5.5.290.0070.08720.73
5.5.280.0030.06720.92
5.5.270.0030.05020.92
5.5.260.0130.08020.91
5.5.250.0070.08020.71
5.5.240.0030.08020.27
5.5.230.0130.07020.01
5.5.220.0070.04020.27
5.5.210.0070.08020.27
5.5.200.0070.07320.27
5.5.190.0070.04320.19
5.5.180.0030.08320.27
5.5.160.0070.07720.24
5.5.150.0070.07720.22
5.5.140.0070.07719.99
5.5.130.0070.05020.26
5.5.120.0070.05020.23
5.5.110.0000.06020.21
5.5.100.0100.06720.05
5.5.90.0070.06320.07
5.5.80.0070.06020.07
5.5.70.0000.07720.06
5.5.60.0070.07720.06
5.5.50.0000.05720.10
5.5.40.0070.05720.04
5.5.30.0030.07720.06
5.5.20.0030.05320.04
5.5.10.0070.07720.04
5.5.00.0070.08020.07
5.4.450.0000.06319.18
5.4.440.0030.07019.51
5.4.430.0030.07719.40
5.4.420.0000.08019.17
5.4.410.0000.08019.32
5.4.400.0030.06719.16
5.4.390.0030.06719.12
5.4.380.0100.06719.04
5.4.370.0000.04718.85
5.4.360.0030.08019.03
5.4.350.0030.07019.03
5.4.340.0030.08019.18
5.4.320.0000.08319.12
5.4.310.0000.07718.90
5.4.300.0070.05319.09
5.4.290.0030.07719.03
5.4.280.0070.05719.03
5.4.270.0030.07718.90
5.4.260.0030.06719.04
5.4.250.0070.07719.09
5.4.240.0030.07018.95
5.4.230.0030.07719.17
5.4.220.0030.06318.94
5.4.210.0070.07319.13
5.4.200.0070.07719.10
5.4.190.0070.06719.02
5.4.180.0130.03319.03
5.4.170.0030.07719.08
5.4.160.0100.05719.16
5.4.150.0070.08319.07
5.4.140.0070.06716.51
5.4.130.0100.06316.40
5.4.120.0070.07016.46
5.4.110.0030.07716.34
5.4.100.0100.04716.47
5.4.90.0030.07316.39
5.4.80.0070.04016.48
5.4.70.0030.03716.33
5.4.60.0030.07316.25
5.4.50.0000.04316.44
5.4.40.0000.04316.46
5.4.30.0030.03316.44
5.4.20.0070.04716.31
5.4.10.0000.07316.31
5.4.00.0000.04015.88
5.3.290.0070.07715.78
5.3.280.0070.07715.78
5.3.270.0070.03715.78
5.3.260.0070.07315.78
5.3.250.0000.06015.78
5.3.240.0100.07015.78
5.3.230.0070.07315.78
5.3.220.0030.07315.78
5.3.210.0030.08015.78
5.3.200.0030.07315.78
5.3.190.0070.07015.78
5.3.180.0030.05315.78
5.3.170.0000.04015.78
5.3.160.0030.06015.78
5.3.150.0030.06015.78
5.3.140.0030.03715.78
5.3.130.0070.07315.78
5.3.120.0000.04715.78
5.3.110.0000.04015.78
5.3.100.0030.08015.78
5.3.90.0000.08015.78
5.3.80.0030.07715.78
5.3.70.0030.05315.78
5.3.60.0070.05715.78
5.3.50.0070.04315.78
5.3.40.0030.06015.78
5.3.30.0070.05315.78
5.3.20.0000.08015.78
5.3.10.0070.07015.78
5.3.00.0070.07015.78
5.2.170.0030.05015.78
5.2.160.0070.05715.78
5.2.150.0030.06315.78
5.2.140.0000.05015.78
5.2.130.0000.05015.78
5.2.120.0030.06015.78
5.2.110.0030.06315.78
5.2.100.0030.05715.78
5.2.90.0000.04015.78
5.2.80.0030.05715.78
5.2.70.0030.06315.78
5.2.60.0030.06015.78
5.2.50.0000.04715.78
5.2.40.0030.05715.78
5.2.30.0000.05315.78
5.2.20.0070.03715.78
5.2.10.0000.06015.78
5.2.00.0000.06715.78
5.1.60.0000.05715.78
5.1.50.0000.04015.78
5.1.40.0100.04015.78
5.1.30.0030.06015.78
5.1.20.0030.05715.78
5.1.10.0030.04715.78
5.1.00.0030.05315.78
5.0.50.0070.04315.78
5.0.40.0030.04715.78
5.0.30.0070.06315.78
5.0.20.0000.04315.78
5.0.10.0030.03715.78
5.0.00.0070.03015.78
4.4.90.0000.03015.78
4.4.80.0000.03715.78
4.4.70.0000.03715.78
4.4.60.0070.02715.78
4.4.50.0070.03015.78
4.4.40.0000.04715.78
4.4.30.0000.03715.78
4.4.20.0030.03015.78
4.4.10.0030.03015.78
4.4.00.0000.05315.78
4.3.110.0030.03715.78
4.3.100.0070.02315.78
4.3.90.0000.03315.78
4.3.80.0000.03315.78
4.3.70.0000.01315.78
4.3.60.0000.01715.78
4.3.50.0030.01315.78
4.3.40.0000.03015.78
4.3.30.0030.01315.78
4.3.20.0070.02315.78
4.3.10.0000.02015.78
4.3.00.0000.01315.78

preferences:
68.37 ms | 401 KiB | 5 Q