Return to bug50006.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / array |
1.1 misho 1: --TEST-- 2: Bug #50006 (Segfault caused by uksort()) 3: --FILE-- 4: <?php 5: 6: $data = array( 7: 'bar-bazbazbaz.' => 0, 8: 'bar-bazbazbaz-' => 0, 9: 'foo' => 0, 10: ); 11: uksort($data, 'magic_sort_cmp'); 12: print_r($data); 13: 14: function 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-- 24: Array 25: ( 26: [foo] => 0 27: [bar-bazbazbaz-] => 0 28: [bar-bazbazbaz.] => 0 29: )