3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $fruits[0]["expiryDate"] = "20142646"; $fruits[1]["expiryDate"] = "20142646"; $fruits[2]["expiryDate"] = "20142646"; usort($fruits, "compareDates"); function compareDates($a, $b) { if (!(isset($a['expiryDate']) && isset($b['expiryDate']))) { return false; } $t1 = strtotime($a['expiryDate']); $t2 = strtotime($b['expiryDate']); return $t1 - $t2; }
based on AWXXX
Output for 4.3.0 - 7.1.0