3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array ( array("DATE" => "2007-01-12", "STUFF"=>"bleh"), array("DATE" => "2007-01-13", "STUFF"=>"bleh"), array("DATE" => "2007-01-01", "STUFF"=>"bleh") ); function cmp($a, $b){ if ($a["DATE"] == $b["DATE"]) return 0; return ($a["DATE"] < $b["DATE"]) ? -1 : 1; } usort($a, "cmp"); var_dump($a);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(3) { [0]=> array(2) { ["DATE"]=> string(10) "2007-01-01" ["STUFF"]=> string(4) "bleh" } [1]=> array(2) { ["DATE"]=> string(10) "2007-01-12" ["STUFF"]=> string(4) "bleh" } [2]=> array(2) { ["DATE"]=> string(10) "2007-01-13" ["STUFF"]=> string(4) "bleh" } }