3v4l.org

run code in 300+ PHP versions simultaneously
<?php $order = [7, 2, 1, 4]; $array = [ 1 => "O", 2 => "T", 4 => "F", 7 => "S" ]; uksort($array, static function (int $key1, int $key2) use ($order): int { return array_search($key1, $order, true) <=> array_search($key2, $order, true); }); print_r($array);

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.140.0120.00917.70
8.4.130.0120.00817.73
8.4.120.0090.00920.51
8.4.110.0090.01222.36
8.4.100.0140.00717.83
8.4.90.0080.00918.67
8.4.80.0100.00919.42
8.4.70.0050.00317.89
8.4.60.0100.01018.68
8.4.50.0110.00520.68
8.4.40.0080.00017.52
8.4.30.0150.00420.68
8.4.20.0140.00717.75
8.4.10.0110.00719.36
8.3.270.0120.00716.40
8.3.260.0110.00716.71
8.3.250.0120.00818.76
8.3.240.0050.00416.70
8.3.230.0040.00516.74
8.3.220.0100.00517.41
8.3.210.0100.00516.60
8.3.200.0130.00616.77
8.3.190.0050.00418.73
8.3.180.0090.00916.50
8.3.170.0120.00617.09
8.3.160.0080.01118.40
8.3.150.0150.00316.53
8.3.140.0090.00617.11
8.3.130.0030.00716.36
8.3.120.0160.00318.92
8.3.110.0060.00320.94
8.3.100.0080.00024.06
8.3.90.0000.00926.77
8.3.80.0060.00316.75
8.3.70.0190.00016.63
8.3.60.0070.01018.30
8.3.50.0080.01224.56
8.3.40.0150.00018.52
8.3.30.0210.00018.65
8.3.20.0040.00424.18
8.3.10.0000.00924.66
8.3.00.0080.00026.16
8.2.290.0130.00620.17
8.2.280.0130.00522.63
8.2.270.0120.00617.35
8.2.260.0090.00616.61
8.2.250.0090.00916.48
8.2.240.0060.00317.21
8.2.230.0060.00322.58
8.2.220.0030.00637.54
8.2.210.0120.00626.77
8.2.200.0080.00016.75
8.2.190.0080.00816.58
8.2.180.0120.00325.92
8.2.170.0090.00618.66
8.2.160.0070.00722.96
8.2.150.0080.00025.66
8.2.140.0050.00324.66
8.2.130.0000.00726.16
8.2.120.0040.00426.35
8.2.110.0060.00322.31
8.2.100.0030.00917.72
8.2.90.0050.00317.75
8.2.80.0030.00518.89
8.2.70.0060.00317.75
8.2.60.0030.00517.93
8.2.50.0040.00418.05
8.2.40.0040.00419.95
8.2.30.0000.00818.14
8.2.20.0070.00018.02
8.2.10.0000.00719.17
8.2.00.0060.00319.23
8.1.330.0120.00821.81
8.1.320.0120.00716.39
8.1.310.0060.00918.43
8.1.300.0080.00020.37
8.1.290.0030.00718.88
8.1.280.0110.00725.92
8.1.270.0030.00621.96
8.1.260.0040.01428.09
8.1.250.0040.00428.09
8.1.240.0060.00323.68
8.1.230.0060.00617.70
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0050.00517.35
8.1.190.0040.00417.35
8.1.180.0080.00018.10
8.1.170.0100.00018.50
8.1.160.0070.00018.90
8.1.150.0000.00718.94
8.1.140.0000.00720.66
8.1.130.0040.00419.24
8.1.120.0040.00417.34
8.1.110.0030.00617.48
8.1.100.0000.00717.36
8.1.90.0040.00417.49
8.1.80.0000.00917.41
8.1.70.0030.00317.50
8.1.60.0000.00817.45
8.1.50.0030.00517.55
8.1.40.0080.00317.52
8.1.30.0000.00717.55
8.1.20.0040.00417.65
8.1.10.0080.00017.57
8.1.00.0030.00617.40
8.0.300.0030.00618.77
8.0.290.0050.00316.63
8.0.280.0030.00318.43
8.0.270.0030.00317.92
8.0.260.0000.00716.82
8.0.250.0050.00216.93
8.0.240.0030.00316.88
8.0.230.0000.00816.97
8.0.220.0000.00716.91
8.0.210.0020.00516.88
8.0.200.0080.00017.00
8.0.190.0040.00416.96
8.0.180.0040.00416.93
8.0.170.0100.00016.94
8.0.160.0040.00416.86
8.0.150.0000.00816.82
8.0.140.0000.00816.81
8.0.130.0000.00513.34
8.0.120.0000.00816.87
8.0.110.0030.00516.84
8.0.100.0000.00716.86
8.0.90.0030.00616.73
8.0.80.0100.00816.83
8.0.70.0040.00416.85
8.0.60.0040.00416.72
8.0.50.0000.00716.84
8.0.30.0150.00417.28
8.0.20.0150.00916.98
8.0.10.0150.01017.14
8.0.00.0200.00616.94
7.4.330.0000.00515.55
7.4.320.0000.00616.56
7.4.300.0030.00316.49
7.4.290.0040.00416.53
7.4.280.0030.00616.63
7.4.270.0030.00316.52
7.4.260.0000.00613.24
7.4.250.0040.00416.47
7.4.240.0040.00416.46
7.4.230.0030.00316.62
7.4.220.0020.00416.63
7.4.210.0080.00816.50
7.4.200.0080.00016.61
7.4.150.0140.01016.43
7.4.140.0170.01116.56
7.4.130.0150.00816.59
7.4.120.0150.01116.54
7.4.110.0170.00716.46
7.4.100.0160.00616.50
7.4.90.0170.01116.46
7.4.80.0130.01316.55
7.4.70.0140.01016.50
7.4.60.0140.00916.45
7.4.50.0200.00316.45
7.4.40.0220.00916.43
7.4.30.0150.01016.49
7.4.20.0160.00916.48
7.4.10.0130.01116.43
7.4.00.0100.01116.58
7.3.330.0000.00716.20
7.3.320.0050.00013.31
7.3.310.0070.00016.34
7.3.300.0070.00016.16
7.3.290.0060.01116.33
7.3.270.0120.01216.39
7.3.260.0100.01516.44
7.3.250.0160.01016.29
7.3.240.0140.00916.40
7.3.230.0170.00816.40
7.3.220.0170.00816.41
7.3.210.0170.01016.36
7.3.200.0170.00916.56
7.3.190.0160.00716.42
7.3.180.0170.01016.48
7.3.170.0150.01216.43
7.3.160.0130.01016.42
7.3.150.0220.01116.43
7.3.140.0140.01216.32
7.3.130.0140.01016.44
7.3.120.0140.00916.29
7.3.110.0150.00916.50
7.3.100.0150.00716.38
7.3.90.0130.00916.41
7.3.80.0130.01016.34
7.3.70.0130.01116.36
7.3.60.0140.00816.38
7.3.50.0160.00916.36
7.3.40.0210.00316.34
7.3.30.0140.00816.41
7.3.20.0180.00616.33
7.3.10.0130.01116.39
7.3.00.0180.00916.31

preferences:
45.82 ms | 403 KiB | 5 Q