3v4l.org

run code in 300+ PHP versions simultaneously
<?php function uasort_key(&$arr, $func) { return uksort($arr, function($a,$b) use($arr,$func) { return $func($arr[$a], $arr[$b], $a, $b); }); } function sort_me($a, $b, $ka = 0, $kb = 0) { return ($a < $b ? -1 : ($a > $b ? 1 : ($ka < $kb ? -1 : ($ka > $kb ? 1 : 0)) )); } $test_array = array(4,6,2,1,7,5,1,34,1,0,4); $test_array_uasort_key = $test_array; uasort_key($test_array_uasort_key, 'sort_me'); print_r($test_array_uasort_key);

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.0070.00716.63
8.3.50.0080.01021.07
8.3.40.0120.00318.83
8.3.30.0090.00618.82
8.3.20.0060.00320.09
8.3.10.0080.00021.82
8.3.00.0040.00421.94
8.2.180.0150.00316.32
8.2.170.0030.01022.96
8.2.160.0070.00720.58
8.2.150.0100.00724.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0060.00319.95
8.2.110.0060.00321.18
8.2.100.0000.01218.03
8.2.90.0040.00419.36
8.2.80.0000.00817.97
8.2.70.0090.00017.50
8.2.60.0080.00017.93
8.2.50.0080.00018.07
8.2.40.0040.00422.34
8.2.30.0030.00719.42
8.2.20.0080.00017.76
8.2.10.0000.00718.13
8.2.00.0000.00818.19
8.1.280.0110.00425.92
8.1.270.0060.01022.14
8.1.260.0000.00726.35
8.1.250.0060.00328.09
8.1.240.0090.00022.55
8.1.230.0040.00817.59
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0070.00317.50
8.1.190.0000.00917.23
8.1.180.0000.00818.10
8.1.170.0000.00818.39
8.1.160.0040.00420.77
8.1.150.0080.00020.67
8.1.140.0060.00319.54
8.1.130.0000.00717.71
8.1.120.0050.00317.41
8.1.110.0030.00517.50
8.1.100.0000.00717.54
8.1.90.0000.00817.38
8.1.80.0060.00317.49
8.1.70.0000.00717.56
8.1.60.0000.00817.50
8.1.50.0000.00817.52
8.1.40.0060.00617.60
8.1.30.0000.00917.57
8.1.20.0060.00317.70
8.1.10.0060.00317.55
8.1.00.0000.00717.41
8.0.300.0000.00718.77
8.0.290.0080.00016.75
8.0.280.0030.00318.44
8.0.270.0070.00017.26
8.0.260.0030.00317.20
8.0.250.0080.00016.85
8.0.240.0030.00316.94
8.0.230.0000.00716.93
8.0.220.0000.00716.88
8.0.210.0050.00316.93
8.0.200.0070.00016.93
8.0.190.0040.00416.93
8.0.180.0070.00016.85
8.0.170.0070.00016.88
8.0.160.0040.00416.86
8.0.150.0040.00416.88
8.0.140.0040.00416.80
8.0.130.0050.00013.31
8.0.120.0030.00516.82
8.0.110.0050.00216.85
8.0.100.0030.00516.93
8.0.90.0040.00416.83
8.0.80.0100.01016.87
8.0.70.0040.00416.88
8.0.60.0000.00716.85
8.0.50.0080.00016.80
8.0.30.0100.01017.16
8.0.20.0090.01217.40
8.0.10.0050.00316.90
8.0.00.0100.01116.75
7.4.330.0000.00516.70
7.4.320.0000.00616.50
7.4.300.0060.00316.41
7.4.290.0000.00816.59
7.4.280.0040.00416.50
7.4.270.0000.00616.58
7.4.260.0040.00416.63
7.4.250.0000.00716.57
7.4.240.0070.00016.54
7.4.230.0030.00316.55
7.4.220.0120.00616.55
7.4.210.0000.01416.55
7.4.200.0000.00716.49
7.4.160.0030.01316.48
7.4.150.0110.00517.40
7.4.140.0160.00617.86
7.4.130.0080.00916.50
7.4.120.0100.00716.64
7.4.110.0030.01516.52
7.4.100.0090.01216.45
7.4.90.0110.00816.34
7.4.80.0090.01719.39
7.4.70.0100.00716.49
7.4.60.0100.00716.68
7.4.50.0070.01116.32
7.4.40.0110.00616.54
7.4.30.0160.00716.50
7.4.00.0030.01014.90
7.3.330.0030.00313.30
7.3.320.0030.00313.24
7.3.310.0040.00416.27
7.3.300.0000.00616.36
7.3.290.0090.01016.36
7.3.280.0080.01016.34
7.3.270.0060.01117.40
7.3.260.0100.00716.44
7.3.250.0130.00516.46
7.3.240.0080.01016.47
7.3.230.0030.01516.41
7.3.210.0130.00316.29
7.3.200.0140.01519.39
7.3.190.0090.00916.50
7.3.180.0060.01116.41
7.3.170.0050.01316.39
7.3.160.0190.00416.28
7.2.330.0120.00616.82
7.2.320.0100.00616.48
7.2.310.0100.00716.48
7.2.300.0120.01116.75
7.2.290.0090.01216.61
7.2.60.0080.00416.57
7.1.200.0030.01015.75
7.1.100.0030.01318.28
7.1.70.0040.01117.19
7.1.60.0110.01419.28
7.1.50.0140.01016.98
7.1.00.0100.07022.51
7.0.200.0070.00316.70
7.0.60.0100.07321.87
7.0.50.0100.07017.88
7.0.40.0070.08720.02
7.0.30.0400.06320.21
7.0.20.0300.06720.26
7.0.10.0070.06720.26
7.0.00.0030.06020.11
5.6.280.0070.07020.79
5.6.210.0030.08320.70
5.6.200.0100.08318.20
5.6.190.0130.05320.77
5.6.180.0300.04320.79
5.6.170.0170.04020.54
5.6.160.0030.08320.48
5.6.150.0000.08018.18
5.6.140.0030.08718.28
5.6.130.0000.04318.24
5.6.120.0100.06721.11
5.6.110.0100.04321.05
5.6.100.0100.08021.14
5.6.90.0070.05321.00
5.6.80.0030.07320.40
5.5.350.4100.03720.45
5.5.340.0030.04318.05
5.5.330.0170.07720.57
5.5.320.0570.07020.24
5.5.310.0130.05020.38
5.5.300.0030.08717.93
5.5.290.0070.08318.01
5.5.280.0100.05720.89
5.5.270.0200.05020.78
5.5.260.0100.04020.87
5.5.250.0070.08720.79
5.5.240.0200.07720.17

preferences:
31.62 ms | 401 KiB | 5 Q