3v4l.org

run code in 300+ PHP versions simultaneously
<?php $gatos = array( array( "id" => 1, "name" => "Titus", "fecha" => "2013-05-14 00:00:00", ), array( "id" => 2, "name" => "Gato", "fecha" => "2010-08-11 00:00:00", ), array( "id" => 3, "name" => "Malinche", "fecha" => "2011-02-28 00:00:00", ), array( "id" => 4, "name" => "Pepito", "fecha" => "2008-05-30 00:00:00", ), ); usort($gatos, function($gato1,$gato2){ return strcmp($gato1["fecha"]->format("md"),$gato2["fecha"]->format("md")); }); var_dump($gatos);

preferences:
32.54 ms | 402 KiB | 5 Q