3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = [1,2,3,4,5,6,1,2,3,4,5,6]; $f = function($a,$b) { return $a <=> $b; }; uasort($a, $f); print_r($a);
based on WDc3b
Output for 7.0.0 - 7.2.0
Array ( [6] => 1 [0] => 1 [1] => 2 [7] => 2 [2] => 3 [8] => 3 [3] => 4 [9] => 4 [4] => 5 [10] => 5 [5] => 6 [11] => 6 )
Output for 5.4.9 - 5.6.28
Parse error: syntax error, unexpected '>' in /in/jFpl1 on line 6
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/jFpl1 on line 3
Process exited with code 255.