3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array( '56'=>array('class_name'=>'6','name'=>'jack','date'=>'2014'), '61'=>array('class_name'=>'2','name'=>'mary','date'=>'2012'), '57'=>array('class_name'=>'5','name'=>'lilei','date'=>'2015') ); uasort($arr, function($a, $b) { return $a['class_name'] - $b['class_name']; }); print_r($arr);
based on lcaHT
Output for 5.3.0 - 7.2.0
Array ( [61] => Array ( [class_name] => 2 [name] => mary [date] => 2012 ) [57] => Array ( [class_name] => 5 [name] => lilei [date] => 2015 ) [56] => Array ( [class_name] => 6 [name] => jack [date] => 2014 ) )
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/PoPIE on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/PoPIE on line 9
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/PoPIE on line 9
Process exited with code 255.