3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [['11-01-2012', 1], ['01-01-2014', 2], ['01-01-2015', 3], ['09-02-2013', 4], ['01-01-2013', 5]]; function date_sort($a, $b) { return strtotime($a[0]) - strtotime($b[0]); } usort($arr, "date_sort"); print_r($arr);
Output for 7.1.33, 7.4.0 - 7.4.29, 8.0.1 - 8.0.19, 8.1.0 - 8.1.6
Array ( [0] => Array ( [0] => 11-01-2012 [1] => 1 ) [1] => Array ( [0] => 01-01-2013 [1] => 5 ) [2] => Array ( [0] => 09-02-2013 [1] => 4 ) [3] => Array ( [0] => 01-01-2014 [1] => 2 ) [4] => Array ( [0] => 01-01-2015 [1] => 3 ) )

preferences:
20.22 ms | 410 KiB | 5 Q