3v4l.org

run code in 300+ PHP versions simultaneously
<?php $gatos = array( array( "id" => 1, "name" => "Titus", "fecha" => new \DateTime(), ), array( "id" => 2, "name" => "Gato", "fecha" => new \DateTime(), ), ); usort($gatos, function($gato1,$gato2){ return strcmp($gato1["fecha"]->format("md"),$gato2["fecha"]->format("md")); }); var_dump($gatos);

preferences:
35.11 ms | 402 KiB | 5 Q