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) { echo "$x"; // 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 4X2HA
Output for 7.0.0 - 7.2.0
foo-test-foo-test
Output for 5.4.11 - 5.6.28
-bar-testfoo-test Warning: uksort(): Array was modified by the user comparison function in /in/LFTof on line 15
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/LFTof on line 3
Process exited with code 255.