3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(array("data" => "abcd", "edit" => "1", "day" => "05", "month" => "04", "year" => "2013"), array("data" => "efgh", "edit" => "2", "day" => "07", "month" => "03", "year" => "2013")); function cmp($a, $b) { $date1 = strtotime($a[0]['year'] . "-" . $a[0]['month'] . "-" . $a[0]['day']); $date2 = strtotime($b[0]['year'] . "-" . $b[0]['month'] . "-" . $b[0]['day']); return $date1 - $date2; } usort($a, "cmp"); print_r($a);
Output for 7.0.0 - 7.1.0
Notice: Undefined offset: 0 in /in/G7hlt on line 15 Notice: Undefined offset: 0 in /in/G7hlt on line 15 Notice: Undefined offset: 0 in /in/G7hlt on line 15 Notice: Undefined offset: 0 in /in/G7hlt on line 16 Notice: Undefined offset: 0 in /in/G7hlt on line 16 Notice: Undefined offset: 0 in /in/G7hlt on line 16 Array ( [0] => Array ( [data] => abcd [edit] => 1 [day] => 05 [month] => 04 [year] => 2013 ) [1] => Array ( [data] => efgh [edit] => 2 [day] => 07 [month] => 03 [year] => 2013 ) )
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined index: 0 in /in/G7hlt on line 15 Notice: Undefined index: 0 in /in/G7hlt on line 15 Notice: Undefined index: 0 in /in/G7hlt on line 15 Notice: Undefined index: 0 in /in/G7hlt on line 16 Notice: Undefined index: 0 in /in/G7hlt on line 16 Notice: Undefined index: 0 in /in/G7hlt on line 16 Array ( [0] => Array ( [data] => abcd [edit] => 1 [day] => 05 [month] => 04 [year] => 2013 ) [1] => Array ( [data] => efgh [edit] => 2 [day] => 07 [month] => 03 [year] => 2013 ) )
Output for 5.3.0 - 5.6.28
Notice: Undefined offset: 0 in /in/G7hlt on line 15 Notice: Undefined offset: 0 in /in/G7hlt on line 15 Notice: Undefined offset: 0 in /in/G7hlt on line 15 Notice: Undefined offset: 0 in /in/G7hlt on line 16 Notice: Undefined offset: 0 in /in/G7hlt on line 16 Notice: Undefined offset: 0 in /in/G7hlt on line 16 Array ( [0] => Array ( [data] => efgh [edit] => 2 [day] => 07 [month] => 03 [year] => 2013 ) [1] => Array ( [data] => abcd [edit] => 1 [day] => 05 [month] => 04 [year] => 2013 ) )
Output for 4.3.0 - 5.2.17
Notice: Undefined offset: 0 in /in/G7hlt on line 15 Notice: Undefined offset: 0 in /in/G7hlt on line 15 Notice: Undefined offset: 0 in /in/G7hlt on line 15 Notice: Undefined offset: 0 in /in/G7hlt on line 16 Notice: Undefined offset: 0 in /in/G7hlt on line 16 Notice: Undefined offset: 0 in /in/G7hlt on line 16 Array ( [0] => Array ( [data] => efgh [edit] => 2 [day] => 07 [month] => 03 [year] => 2013 ) [1] => Array ( [data] => abcd [edit] => 1 [day] => 05 [month] => 04 [year] => 2013 ) )