3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'id' => 2, 'type' => 'comment', 'text' => 'hey', 'datetime' => '2010-05-15 11:29:45' ], [ 'id' => 3, 'type' => 'status', 'text' => 'oi', 'datetime' => '2010-05-26 15:59:53' ], [ 'id' => 4, 'type' => 'status', 'text' => 'yeww', 'datetime' => '2010-05-26 16:04:24' ] ]; // usort() by date column DESC: usort($array, function($a, $b) { return $b['datetime'] <=> $a['datetime']; }); echo var_export($array, true) . "\n***\n"; // usort() by date column ASC: usort($array, function($a, $b) { return $a['datetime'] <=> $b['datetime']; }); echo var_export($array, true) . "\n***\n"; // usort() by date column ASC in >= PHP7.4: //usort($array, fn($a, $b) => $a['datetime'] <=> $b['datetime']); // array_multisort() by date column DESC: array_multisort(array_column($array, 'datetime'), SORT_DESC, $array); echo var_export($array, true) . "\n***\n"; // array_multisort() by date column ASC: array_multisort(array_column($array, 'datetime'), $array); echo var_export($array, true) . "\n***\n";

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.130.0030.00618.65
8.3.120.0100.01018.82
8.3.110.0040.00420.94
8.3.100.0030.00616.50
8.3.90.0080.00026.77
8.3.80.0030.00916.50
8.3.70.0070.00716.75
8.3.60.0100.00716.63
8.3.50.0100.00716.58
8.3.40.0140.00718.89
8.3.30.0070.00718.71
8.3.20.0040.00424.18
8.3.10.0000.00824.66
8.3.00.0050.00326.16
8.2.250.0040.00418.44
8.2.240.0060.00918.88
8.2.230.0060.00322.58
8.2.220.0060.00337.54
8.2.210.0110.00726.77
8.2.200.0060.00316.75
8.2.190.0060.00916.75
8.2.180.0110.01525.92
8.2.170.0120.00318.96
8.2.160.0100.00322.96
8.2.150.0000.00825.66
8.2.140.0080.00024.66
8.2.130.0070.00726.16
8.2.120.0070.00020.93
8.2.110.0030.00620.52
8.2.100.0090.00317.84
8.2.90.0000.00817.88
8.2.80.0080.00018.73
8.2.70.0030.00518.03
8.2.60.0080.00018.16
8.2.50.0050.00318.10
8.2.40.0030.00621.08
8.2.30.0030.00619.21
8.2.20.0080.00018.14
8.2.10.0080.00019.40
8.2.00.0110.00218.51
8.1.300.0050.00518.06
8.1.290.0050.00530.84
8.1.280.0070.00725.92
8.1.270.0040.00423.99
8.1.260.0000.00826.35
8.1.250.0000.00728.09
8.1.240.0030.00623.82
8.1.230.0080.00320.90
8.1.220.0000.00817.74
8.1.210.0000.00918.77
8.1.200.0080.00017.22
8.1.190.0030.00617.22
8.1.180.0000.00918.10
8.1.170.0040.00418.64
8.1.160.0040.00420.65
8.1.150.0050.00218.82
8.1.140.0040.00418.83
8.1.130.0100.00218.80
8.1.120.0070.00517.39
8.1.110.0070.00517.45
8.1.100.0070.00517.39
8.1.90.0080.00517.54
8.1.80.0090.00317.38
8.1.70.0030.00917.48
8.1.60.0060.00817.62
8.1.50.0050.00817.52
8.1.40.0080.00517.62
8.1.30.0030.00717.63
8.1.20.0040.00617.68
8.1.10.0110.00217.58
8.1.00.0050.00717.51
8.0.300.0060.00318.77
8.0.290.0030.00616.75
8.0.280.0000.00818.43
8.0.270.0030.00616.82
8.0.260.0080.00317.62
8.0.250.0080.00316.91
8.0.240.0070.00416.92
8.0.230.0070.00416.92
8.0.220.0020.01016.87
8.0.210.0070.00416.80
8.0.200.0030.00816.91
8.0.190.0050.00716.90
8.0.180.0040.00616.82
8.0.170.0060.00416.91
8.0.160.0090.00216.83
8.0.150.0090.00116.82
8.0.140.0070.00316.86
8.0.130.0050.00315.11
8.0.120.0070.00316.87
8.0.110.0080.00316.85
8.0.100.0070.00516.79
8.0.90.0020.00716.88
8.0.80.0050.00816.83
8.0.70.0020.00616.87
8.0.60.0030.00516.82
8.0.50.0030.00716.93
8.0.30.0050.00816.88
8.0.20.0040.00917.49
8.0.10.0080.00417.58
8.0.00.0050.00917.63
7.4.330.0000.00916.21
7.4.320.0080.00416.74
7.4.300.0050.00616.69
7.4.290.0070.00516.65
7.4.280.0090.00316.69
7.4.270.0060.00616.71
7.4.260.0060.00515.09
7.4.250.0060.00616.65
7.4.240.0030.00616.66
7.4.230.0090.00316.66
7.4.220.0080.00216.73
7.4.210.0080.00716.62
7.4.200.0050.00516.73
7.4.190.0130.00016.87
7.4.180.0080.00616.87
7.4.160.0100.00516.65
7.4.150.0060.00916.65
7.4.140.0090.00616.59
7.4.130.0080.00716.65
7.4.120.0110.00316.63
7.4.110.0080.00716.63
7.4.100.0080.00716.64
7.4.90.0080.00716.61
7.4.80.0050.01016.54
7.4.70.0100.00416.63
7.4.60.0110.00416.58
7.4.50.0100.00816.61
7.4.40.0090.00416.53
7.4.30.0100.00616.60
7.4.20.0120.00516.58
7.4.10.0080.00716.69
7.4.00.0060.00916.59
7.3.330.0070.00416.60
7.3.320.0100.00014.98
7.3.310.0040.00716.58
7.3.300.0090.00216.56
7.3.290.0060.00416.50
7.3.280.0080.00616.51
7.3.270.0080.00616.45
7.3.260.0080.00716.46
7.3.250.0090.00516.42
7.3.240.0080.00616.41
7.3.230.0100.00516.46
7.3.220.0070.00816.41
7.3.210.0070.00716.44
7.3.200.0080.00516.47
7.3.190.0080.00616.47
7.3.180.0070.00816.47
7.3.170.0080.00816.41
7.3.160.0080.00616.44
7.3.150.0080.00816.46
7.3.140.0090.00716.40
7.3.130.0090.00616.44
7.3.120.0110.00416.42
7.3.110.0100.00616.36
7.3.100.0070.01016.38
7.3.90.0100.00516.58
7.3.80.0090.00516.42
7.3.70.0130.00416.50
7.3.60.0110.00617.01
7.3.50.0120.00616.56
7.3.40.0090.00816.52
7.3.30.0070.01016.58
7.3.20.0130.00416.95
7.3.10.0090.00716.88
7.3.00.0070.00916.93

preferences:
27.36 ms | 403 KiB | 5 Q