3v4l.org

run code in 300+ PHP versions simultaneously
<?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.12, 5.4.14
Parse error: syntax error, unexpected 'cmp' (T_STRING), expecting '(' in BojN8 on line 15
Process exited with code 255.
Output for 5.4.13
Parse error: syntax error, unexpected 'cmp' (T_STRING), expecting '(' in /in/abIKu on line 15
Process exited with code 255.
Output for 5.3.0 - 5.3.22, 5.3.24
Parse error: syntax error, unexpected T_STRING, expecting '(' in BojN8 on line 15
Process exited with code 255.
Output for 5.3.23
Parse error: syntax error, unexpected T_STRING, expecting '(' in /in/abIKu on line 15
Process exited with code 255.

preferences:
172.06 ms | 1399 KiB | 47 Q