Classifique uma matriz de datas usando as funções usort () e sort () pelo timestamp convertido por mktime ()

Eu tenho uma matriz de datas e eu tenho que classificá-lo usando as funções descritas.

Aqui está o que eu tenho:

$dates = array ('10-10-2003', '2-17-2002', '2-16-2003','1-01-2005', '10-10-2004' );
function date_to_timestamp($d){
$newarr = array();
foreach($d as $f) {
    $arr=explode("-",$f);
    array_push($newarr, mktime(0,0,0,$arr[0],$arr[1],$arr[2]));
}
return $newarr;
}

function cmp2($a, $b)
{
if ($a == $b) {
    return 0;
}
return ($a < $b) ? -1 : 1;
}

$third = date_to_timestamp($dates);


usort($third, "cmp2");
print_r($third);

?>

Depois disso, esta é a saída maluca que recebo:

Matriz ([0] => 1013922000 [1] => 1045371600 [2] => 1065758400 [3] => 1097380800 [4] => 1104555600)

Onde está o meu erro? Eu apreciarei qualquer ajuda com a solução.

questionAnswers(2)

yourAnswerToTheQuestion