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.5.20.0060.00219.58
8.5.10.0120.00619.80
8.5.00.0090.01320.04
8.4.170.0150.01120.66
8.4.160.0120.00823.98
8.4.150.0020.00114.05
8.4.140.0160.00617.68
8.4.130.0160.00918.85
8.4.120.0120.00924.21
8.4.110.0130.00718.92
8.4.100.0120.00917.75
8.4.90.0110.01017.71
8.4.80.0110.00918.10
8.4.70.0060.00619.39
8.4.60.0120.00818.61
8.4.50.0090.00619.57
8.4.40.0130.00719.50
8.4.30.0090.00918.91
8.4.20.0080.01122.50
8.4.10.0060.00325.89
8.3.300.0090.01220.83
8.3.290.0100.01118.49
8.3.280.0110.00918.54
8.3.270.0110.00916.86
8.3.260.0100.00916.87
8.3.250.0120.00618.73
8.3.240.0070.01117.38
8.3.230.0110.00916.74
8.3.220.0090.00917.43
8.3.210.0100.00916.53
8.3.200.0090.01116.73
8.3.190.0100.00918.89
8.3.180.0040.00516.52
8.3.170.0060.01318.64
8.3.160.0100.01016.88
8.3.150.0000.01918.87
8.3.140.0120.00617.48
8.3.130.0050.00518.59
8.3.120.0000.00818.93
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.300.0110.00918.04
8.2.290.0140.00520.56
8.2.280.0130.00618.55
8.2.270.0120.00617.25
8.2.260.0040.00819.04
8.2.250.0090.00016.71
8.2.240.0060.00319.03
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.340.0100.01017.74
8.1.330.0130.00616.57
8.1.320.0100.00917.96
8.1.310.0090.00618.69
8.1.300.0120.00318.45
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:
122.85 ms | 403 KiB | 5 Q