1--TEST--
2Bug #50006 (Segfault caused by uksort()) - uasort variant
3--FILE--
4<?php
5
6$data = array(
7    'bar-bazbazbaz.',
8    'bar-bazbazbaz-',
9    'foo'
10);
11uasort($data, 'magic_sort_cmp');
12print_r($data);
13
14function magic_sort_cmp($a, $b) {
15  $a = substr($a, 1);
16  $b = substr($b, 1);
17  if (!$a) return $b ? -1 : 0;
18  if (!$b) return 1;
19  return magic_sort_cmp($a, $b);
20}
21
22?>
23--EXPECTF--
24Array
25(
26    [2] => foo
27    [0] => bar-bazbazbaz.
28    [1] => bar-bazbazbaz-
29)
30