3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [], ['2011','2010', '2012'], ['conference', 'journal', 'conference'], ]; function array_multisort_custom(array &$array, $columnKey, array $order) { // guard clause/condition if (!array_key_exists($columnKey, $array)) { throw new Exception('Nominated sorting column not found'); } // pad rows to consistent size $maxCount = max(array_map('count', $array)); array_walk($array, fn(&$row) => $row = array_pad($row, $maxCount, null)); // populate first sorting parameter with custom order array $priority = array_flip($order); $default = count($order); array_multisort( array_map(fn($v) => $priority[$v] ?? $default, $array[$columnKey]), ...$array ); } array_multisort_custom($array, 2, ['conference', 'journal']); var_export($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.3.110.0000.00920.94
8.3.100.0070.00316.90
8.3.90.0080.00816.63
8.3.80.0000.00817.97
8.3.70.0090.00616.50
8.3.60.0100.00618.27
8.3.50.0150.00016.67
8.3.40.0140.00420.26
8.3.30.0110.00818.89
8.3.20.0040.00424.18
8.3.10.0050.00324.66
8.3.00.0000.00726.16
8.2.230.0090.00022.58
8.2.220.0080.00024.06
8.2.210.0040.00426.77
8.2.200.0000.00916.75
8.2.190.0110.00416.63
8.2.180.0140.00716.75
8.2.170.0120.00319.08
8.2.160.0070.00722.96
8.2.150.0070.00025.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0070.00019.95
8.2.110.0030.00719.34
8.2.100.0080.00417.72
8.2.90.0040.00819.58
8.2.80.0000.00817.75
8.2.70.0080.00017.63
8.2.60.0080.00018.03
8.2.50.0000.00818.07
8.2.40.0000.00819.83
8.2.30.0000.00818.28
8.2.20.0040.00419.42
8.2.10.0050.00517.71
8.2.00.0070.00417.78
8.1.290.0090.00018.88
8.1.280.0100.01025.92
8.1.270.0070.00724.66
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0060.00322.57
8.1.230.0030.00922.83
8.1.220.0030.00617.77
8.1.210.0030.00518.96
8.1.200.0030.00617.38
8.1.190.0000.00817.35
8.1.180.0050.00322.20
8.1.170.0090.00018.75
8.1.160.0000.00818.93
8.1.150.0040.00418.56
8.1.140.0090.00017.41
8.1.130.0060.00317.46
8.1.120.0060.00317.55
8.1.110.0030.00617.58
8.1.100.0080.00017.39
8.1.90.0050.00517.57
8.1.80.0040.00417.58
8.1.70.0090.00017.55
8.1.60.0030.00517.64
8.1.50.0050.00517.51
8.1.40.0070.00317.64
8.1.30.0100.00317.57
8.1.20.0050.00517.54
8.1.10.0000.00917.62
8.1.00.0070.00317.58
8.0.300.0040.00420.11
8.0.290.0040.00417.00
8.0.280.0040.00418.43
8.0.270.0090.00016.92
8.0.260.0000.00816.88
8.0.250.0020.00516.91
8.0.240.0000.00817.10
8.0.230.0060.00316.98
8.0.220.0000.00716.95
8.0.210.0080.00016.97
8.0.200.0040.00417.00
8.0.190.0040.00417.00
8.0.180.0070.00016.88
8.0.170.0000.00717.03
8.0.160.0050.00217.04
8.0.150.0070.00016.99
8.0.140.0040.00416.89
8.0.130.0000.00816.88
8.0.120.0050.00316.88
8.0.110.0080.00016.91
8.0.100.0000.00816.83
8.0.90.0040.00416.83
8.0.80.0060.00316.73
8.0.70.0050.00316.79
8.0.60.0000.00716.92
8.0.50.0040.00416.91
8.0.30.0040.00416.86
8.0.20.0040.00316.95
8.0.10.0000.00717.05

preferences:
25.52 ms | 403 KiB | 5 Q