3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array(array("data" => "abcd", "edit" => "1", "day" => "05", "month" => "04", "year" => "2013"), array("data" => "efgh", "edit" => "2", "day" => "07", "month" => "03", "year" => "2013")); function cmp($a, $b) { $date1 = strtotime($a['year'] . "-" . $a['month'] . "-" . $a['day']); $date2 = strtotime($b['year'] . "-" . $b['month'] . "-" . $b['day']); return $date1 - $date2; } usort($array, "cmp"); print_r($array);
Output for 5.2.14 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => Array ( [data] => efgh [edit] => 2 [day] => 07 [month] => 03 [year] => 2013 ) [1] => Array ( [data] => abcd [edit] => 1 [day] => 05 [month] => 04 [year] => 2013 ) )