3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ "30-12-2024", "28-12-2024", "28-12-2024", "28-12-2024", "03-01-2025" ]; usort($arr, function ($a, $b) { return strtotime($a) - strtotime($b); }); print_r($arr);
Output for 8.2.0 - 8.2.27, 8.3.0 - 8.3.16, 8.4.1 - 8.4.2
Array ( [0] => 28-12-2024 [1] => 28-12-2024 [2] => 28-12-2024 [3] => 30-12-2024 [4] => 03-01-2025 )

preferences:
43.84 ms | 406 KiB | 5 Q