3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = range('a', 'z'); $ret = uksort($array, function ($a, $b) use (&$array) { unset($array[$a]); return 0; }); var_dump($ret, $array);
Output for hhvm-3.12.0, 7.0.6 - 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 7.0.0 - 7.0.5
Warning: uksort(): Array was modified by the user comparison function in /in/CaINM on line 7 bool(false) array(1) { [25]=> string(1) "z" }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.3.2 - 5.6.28
Warning: uksort(): Array was modified by the user comparison function in /in/CaINM on line 7 bool(false) 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 5.3.1
bool(true) array(0) { [32394816]=> int(32394768) [32402680]=> int(32402632) [32402512]=> int(32402464) [32402376]=> int(32402328) [32394344]=> int(32394296) [32394984]=> int(32394936) [32395152]=> int(32395072) [32400936]=> int(32393056) [32402040]=> int(32401992) [32395656]=> int(32395576) [32395488]=> int(32395408) [32395320]=> int(32395240) [32402208]=> int(32402160) [0]=> int(0) [32401192]=> int(32401144) [32393368]=> int(32393320) [32393200]=> int(32393152) [32401024]=> int(32393104) [32401528]=> int(32401480) [32401360]=> int(32401312) [32394176]=> int(32394128) [32393840]=> int(32393792) [32394008]=> int(32393960) [32393536]=> int(32393488) [32401872]=> int(32401824) [32395824]=> int(32395744) }
Output for 5.3.0
bool(true) array(0) { [30092128]=> int(30092080) [30099992]=> int(30099944) [30099824]=> int(30099776) [30099688]=> int(30099640) [30091656]=> int(30091608) [30092296]=> int(30092248) [30092464]=> int(30092384) [30098248]=> int(30090368) [30099352]=> int(30099304) [30092968]=> int(30092888) [30092800]=> int(30092720) [30092632]=> int(30092552) [30099520]=> int(30099472) [0]=> int(0) [30098504]=> int(30098456) [30090680]=> int(30090632) [30090512]=> int(30090464) [30098336]=> int(30090416) [30098840]=> int(30098792) [30098672]=> int(30098624) [30091488]=> int(30091440) [30091152]=> int(30091104) [30091320]=> int(30091272) [30090848]=> int(30090800) [30099184]=> int(30099136) [30093136]=> int(30093056) }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/CaINM 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/CaINM on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/CaINM on line 4
Process exited with code 255.