3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = ['foo-test' => [1], '-' => [2], 'bar-test' => [3]]; uksort($a, function($x, $y) use (&$a) { if (!isset($a[$x])) { // throw new Exception("Key '{$x}' not found."); } if (!isset($a[$y])) { // throw new Exception("Key '{$y}' not found."); } return $x < $y; });
based on BYHJl
Output for 7.0.0 - 7.2.0
Output for 5.4.11 - 5.6.21
Warning: uksort(): Array was modified by the user comparison function in /in/FhqYD on line 14
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/FhqYD on line 3
Process exited with code 255.