3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array(); $array['test'][74] = '11111'; $array['test'][71] = '1123'; $array['test'][72] = '114444'; usort($array['test'], 'compare'); print_r($array);
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: usort() expects parameter 2 to be a valid callback, function 'compare' not found or invalid function name in /in/mTE8a on line 10 Array ( [test] => Array ( [74] => 11111 [71] => 1123 [72] => 114444 ) )
Output for hhvm-3.12.0
Warning: Invalid argument: function: method 'compare' not found in /in/mTE8a on line 10 Array ( [test] => Array ( [74] => 11111 [71] => 1123 [72] => 114444 ) )
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.2.5 - 5.2.17
Warning: usort(): Invalid comparison function in /in/mTE8a on line 10 Array ( [test] => Array ( [74] => 11111 [71] => 1123 [72] => 114444 ) )
Output for 4.3.9 - 5.2.4
Warning: usort(): Invalid comparison function. in /in/mTE8a on line 10 Array ( [test] => Array ( [74] => 11111 [71] => 1123 [72] => 114444 ) )
Output for 4.3.0 - 4.3.8
Array ( [test] => Array ( [0] => 114444 [1] => 1123 [2] => 11111 ) )