3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ['foo-test' => [1], '-' => [2], 'bar-test' => [3]]; uksort($a, function($x, $y) use (&$a) { var_dump($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; });

preferences:
133.1 ms | 402 KiB | 5 Q