3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = array(array("data" => "abcd", "edit" => "1", "day" => "05", "month" => "04", "year" => "2013"), array("data" => "efgh", "edit" => "2", "day" => "07", "month" => "03", "year" => "2013")); usort($data, function cmp($a, $b) { $date1 = DateTime::createFromFormat("d/m/Y", $a["day"].'/'.$a["month"].'/'.$a["year"]); $date2 = DateTime::createFromFormat("d/m/Y", $b["day"].'/'.$b["month"].'/'.$b["year"]); return $date1->getTimestamp() - $date2->getTimestamp(); }); var_dump($data);
Output for 5.4.0 - 5.4.14
Parse error: syntax error, unexpected 'cmp' (T_STRING), expecting '(' in /in/BojN8 on line 15
Process exited with code 255.
Output for 5.3.0 - 5.3.24
Parse error: syntax error, unexpected T_STRING, expecting '(' in /in/BojN8 on line 15
Process exited with code 255.