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); $order = array_map(fn($v) => $priority[$v] ?? $default, $array[$columnKey]); array_multisort($order, ...$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.5.20.0080.01019.32
8.5.10.0110.00720.15
8.5.00.0100.01220.26
8.4.170.0070.00322.04
8.4.160.0130.00923.84
8.4.150.0020.00014.05
8.4.140.0150.00717.57
8.4.130.0140.00618.86
8.4.120.0090.00919.63
8.4.110.0060.00520.54
8.4.100.0140.00717.67
8.4.90.0120.01020.80
8.4.80.0050.00319.00
8.4.70.0060.00318.99
8.4.60.0130.00718.95
8.4.50.0120.00919.42
8.4.40.0160.00319.13
8.4.30.0130.00618.53
8.4.20.0150.00322.42
8.4.10.0030.01324.09
8.3.300.0080.01218.64
8.3.290.0110.00620.62
8.3.280.0150.00518.47
8.3.270.0150.00416.38
8.3.260.0080.01016.62
8.3.250.0130.00718.99
8.3.240.0050.00416.69
8.3.230.0090.01016.76
8.3.220.0060.00218.96
8.3.210.0090.00918.44
8.3.200.0040.00516.63
8.3.190.0080.00618.93
8.3.180.0110.00916.52
8.3.170.0130.00619.06
8.3.160.0000.01816.63
8.3.150.0080.00018.98
8.3.140.0100.00016.48
8.3.130.0080.00018.52
8.3.120.0000.01618.99
8.3.110.0000.00920.94
8.3.100.0030.00618.43
8.3.90.0110.00326.77
8.3.80.0090.00018.43
8.3.70.0130.01016.75
8.3.60.0070.01018.52
8.3.50.0150.00616.68
8.3.40.0040.01120.34
8.3.30.0100.00318.59
8.3.20.0060.00324.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.300.0120.00922.28
8.2.290.0050.00316.70
8.2.280.0140.00618.56
8.2.270.0180.00017.04
8.2.260.0090.00920.64
8.2.250.0090.00617.18
8.2.240.0130.00618.79
8.2.230.0030.00722.58
8.2.220.0070.00324.06
8.2.210.0060.00326.77
8.2.200.0060.00318.54
8.2.190.0090.00616.63
8.2.180.0130.00716.50
8.2.170.0090.00919.07
8.2.160.0090.00622.96
8.2.150.0030.00525.66
8.2.140.0040.00424.66
8.2.130.0050.00226.16
8.2.120.0000.00826.16
8.2.110.0030.00721.18
8.2.100.0060.00617.91
8.2.90.0030.00719.76
8.2.80.0000.00817.50
8.2.70.0030.00517.63
8.2.60.0030.00517.93
8.2.50.0050.00318.07
8.2.40.0080.00020.01
8.2.30.0040.00418.30
8.2.20.0000.00719.37
8.2.10.0040.00717.88
8.2.00.0080.00317.66
8.1.340.0140.01117.65
8.1.330.0100.01016.48
8.1.320.0140.00517.94
8.1.310.0140.00316.63
8.1.300.0040.00419.80
8.1.290.0040.00730.84
8.1.280.0070.00725.92
8.1.270.0040.00424.66
8.1.260.0050.00226.35
8.1.250.0090.00928.09
8.1.240.0030.00622.50
8.1.230.0040.00821.03
8.1.220.0050.00317.75
8.1.210.0050.00318.93
8.1.200.0050.00517.22
8.1.190.0050.00317.35
8.1.180.0080.00022.03
8.1.170.0050.00318.91
8.1.160.0060.00318.87
8.1.150.0040.00418.59
8.1.140.0120.00017.45
8.1.130.0150.00217.45
8.1.120.0130.00617.43
8.1.110.0180.00317.62
8.1.100.0120.00917.43
8.1.90.0170.00217.57
8.1.80.0120.00917.52
8.1.70.0090.00317.55
8.1.60.0030.00817.65
8.1.50.0060.00317.53
8.1.40.0020.00917.65
8.1.30.0030.00817.58
8.1.20.0050.00517.71
8.1.10.0070.00717.63
8.1.00.0090.00617.50
8.0.300.0040.00420.17
8.0.290.0040.00416.88
8.0.280.0070.00018.41
8.0.270.0130.00016.75
8.0.260.0030.00616.92
8.0.250.0030.00616.98
8.0.240.0130.00016.98
8.0.230.0000.00917.04
8.0.220.0080.00016.80
8.0.210.0000.00816.83
8.0.200.0050.00516.97
8.0.190.0050.00516.97
8.0.180.0000.00916.89
8.0.170.0000.00916.97
8.0.160.0080.00016.89
8.0.150.0040.00416.96
8.0.140.0040.00416.92
8.0.130.0070.00716.80
8.0.120.0140.00016.80
8.0.110.0000.00916.91
8.0.100.0090.00316.80
8.0.90.0060.00916.82
8.0.80.0100.00316.79
8.0.70.0070.00716.79
8.0.60.0030.01116.81
8.0.50.0120.00316.86
8.0.30.0140.00016.78
8.0.20.0040.00716.89
8.0.10.0130.00016.99

preferences:
32.83 ms | 403 KiB | 5 Q