3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'note' => [], 'year' => ['2011','2010', '2012'], 'type' => ['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); foreach ($array[$columnKey] as $v) { $params[0][] = $priority[$v] ?? $default; } // assign reference variables to parameter array for all rows foreach ($array as &$row) { $params[] = &$row; } array_multisort(...$params); } array_multisort_custom($array, 'type', ['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.00.0110.01020.20
8.4.150.0010.00014.05
8.4.140.0110.00917.67
8.4.130.0060.01318.96
8.4.120.0130.00823.99
8.4.110.0170.00420.36
8.4.100.0120.00817.97
8.4.90.0150.00620.30
8.4.80.0090.01018.75
8.4.70.0090.00618.75
8.4.60.0100.01318.90
8.4.50.0110.01019.21
8.4.40.0200.00019.17
8.4.30.0130.00618.82
8.4.20.0040.01422.41
8.4.10.0070.01023.96
8.3.280.0120.01020.05
8.3.270.0110.00916.65
8.3.260.0140.00616.47
8.3.250.0100.00918.98
8.3.240.0080.01017.25
8.3.230.0120.00816.69
8.3.220.0130.00418.95
8.3.210.0040.00418.29
8.3.200.0070.00316.86
8.3.190.0100.00619.19
8.3.180.0090.00916.68
8.3.170.0090.00017.18
8.3.160.0140.00416.55
8.3.150.0030.01317.07
8.3.140.0110.00716.84
8.3.130.0060.00318.59
8.3.120.0030.00620.76
8.3.110.0030.00620.94
8.3.100.0060.00324.06
8.3.90.0060.00326.77
8.3.80.0030.00618.68
8.3.70.0090.00616.75
8.3.60.0120.00318.30
8.3.50.0070.00718.35
8.3.40.0130.00720.48
8.3.30.0060.01018.81
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.290.0130.00616.68
8.2.280.0090.00618.30
8.2.270.0090.00916.73
8.2.260.0000.01816.51
8.2.250.0120.00418.30
8.2.240.0060.01218.85
8.2.230.0000.01022.58
8.2.220.0060.00337.54
8.2.210.0030.00626.77
8.2.200.0030.00716.50
8.2.190.0090.00618.07
8.2.180.0090.00918.54
8.2.170.0070.00718.95
8.2.160.0140.00322.96
8.2.150.0050.00325.66
8.2.140.0060.00324.66
8.2.130.0000.00826.16
8.2.120.0080.00026.16
8.2.110.0060.00320.92
8.2.100.0090.00317.78
8.2.90.0060.00319.52
8.2.80.0040.00417.97
8.2.70.0080.00018.05
8.2.60.0000.00719.21
8.2.50.0000.00818.10
8.2.40.0000.00820.30
8.2.30.0070.00018.06
8.2.20.0000.00719.21
8.2.10.0130.00617.75
8.2.00.0160.00517.64
8.1.330.0050.00616.12
8.1.320.0140.00517.68
8.1.310.0110.00716.38
8.1.300.0030.01320.34
8.1.290.0080.00030.84
8.1.280.0060.00925.92
8.1.270.0130.00622.17
8.1.260.0050.00226.35
8.1.250.0070.00028.09
8.1.240.0060.00324.02
8.1.230.0080.00320.89
8.1.220.0000.00717.78
8.1.210.0030.00518.96
8.1.200.0000.00817.36
8.1.190.0060.00317.35
8.1.180.0050.00318.10
8.1.170.0050.00318.66
8.1.160.0040.00418.94
8.1.150.0030.00518.64
8.1.140.0100.00717.37
8.1.130.0120.00417.50
8.1.120.0000.01617.46
8.1.110.0140.00517.52
8.1.100.0150.00317.40
8.1.90.0120.00417.57
8.1.80.0160.00317.52
8.1.70.0100.00717.46
8.1.60.0160.00317.58
8.1.50.0150.00617.59
8.1.40.0100.01017.70
8.1.30.0150.00517.62
8.1.20.0150.00617.56
8.1.10.0180.00417.60
8.1.00.0160.00817.63
8.0.300.0040.00419.84
8.0.290.0030.00516.63
8.0.280.0040.00418.52
8.0.270.0120.00816.85
8.0.260.0130.00316.85
8.0.250.0150.00316.94
8.0.240.0130.00316.96
8.0.230.0100.00716.87
8.0.220.0140.00316.80
8.0.210.0090.00916.77
8.0.200.0130.00416.87
8.0.190.0140.00316.85
8.0.180.0180.00016.83
8.0.170.0130.00416.96
8.0.160.0100.00716.95
8.0.150.0080.00816.76
8.0.140.0160.00016.98
8.0.130.0150.00016.88
8.0.120.0090.00916.89
8.0.110.0090.00616.88
8.0.100.0110.00816.80
8.0.90.0130.00416.86
8.0.80.0100.00716.85
8.0.70.0160.00016.89
8.0.60.0110.00616.89
8.0.50.0110.00816.82
8.0.30.0170.00016.88
8.0.20.0090.00916.89
8.0.10.0080.00817.02

preferences:
28.18 ms | 403 KiB | 5 Q