3v4l.org

run code in 300+ PHP versions simultaneously
<?php $win = array('Name'=> array('Jane Doe ', 'Nash Patel ', 'Joe Public '), 'Date'=> array('7 October 2015 ', '14 October 2014 ', '12 October 2016 ')); $dates = $win["Date"]; $names = $win["Name"]; usort($dates, "date_sort"); asort($names); var_dump($dates); Var_dump($names); function date_sort($a, $b) { return strtotime($a) - strtotime($b); }
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.6 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
array(3) { [0]=> string(16) "14 October 2014 " [1]=> string(15) "7 October 2015 " [2]=> string(16) "12 October 2016 " } array(3) { [0]=> string(9) "Jane Doe " [2]=> string(11) "Joe Public " [1]=> string(11) "Nash Patel " }

preferences:
123.66 ms | 404 KiB | 204 Q