3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = range('a', 'z'); $ret = uksort($array, function ($a, &$b) { $b = 'z'; return 0; }); var_dump($ret, $array);
Output for hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
bool(true) array(26) { [0]=> string(1) "a" [14]=> string(1) "o" [24]=> string(1) "y" [23]=> string(1) "x" [22]=> string(1) "w" [21]=> string(1) "v" [20]=> string(1) "u" [19]=> string(1) "t" [18]=> string(1) "s" [17]=> string(1) "r" [16]=> string(1) "q" [15]=> string(1) "p" [13]=> string(1) "n" [1]=> string(1) "b" [12]=> string(1) "m" [11]=> string(1) "l" [10]=> string(1) "k" [9]=> string(1) "j" [8]=> string(1) "i" [7]=> string(1) "h" [6]=> string(1) "g" [5]=> string(1) "f" [4]=> string(1) "e" [3]=> string(1) "d" [2]=> string(1) "c" [25]=> string(1) "z" }
Output for 5.3.0 - 5.6.28
bool(true) array(26) { [17]=> string(1) "r" [18]=> string(1) "s" [16]=> string(1) "q" [15]=> string(1) "p" [14]=> string(1) "o" [19]=> string(1) "t" [20]=> string(1) "u" [24]=> string(1) "y" [25]=> string(1) "z" [23]=> string(1) "x" [22]=> string(1) "w" [21]=> string(1) "v" [13]=> string(1) "n" [12]=> string(1) "m" [4]=> string(1) "e" [5]=> string(1) "f" [3]=> string(1) "d" [2]=> string(1) "c" [1]=> string(1) "b" [6]=> string(1) "g" [7]=> string(1) "h" [11]=> string(1) "l" [10]=> string(1) "k" [9]=> string(1) "j" [8]=> string(1) "i" [0]=> string(1) "a" }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/a1dp3 on line 4
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/a1dp3 on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/a1dp3 on line 4
Process exited with code 255.