Return to bug25359.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / array |
1.1 misho 1: --TEST-- 2: Bug #25359 (array_multisort() does not work in a function if array is global or reference) 3: --FILE-- 4: <?php 5: 6: function does_not_work() 7: { 8: global $data; // Remove this line to make array_multisort() work 9: 10: $data = array('first', 'fifth', 'second', 'forth', 'third'); 11: $sort = array(1, 5, 2, 4, 3); 12: array_multisort($sort, $data); 13: 14: var_dump($data); 15: } 16: 17: does_not_work(); 18: 19: ?> 20: --EXPECT-- 21: array(5) { 22: [0]=> 23: string(5) "first" 24: [1]=> 25: string(6) "second" 26: [2]=> 27: string(5) "third" 28: [3]=> 29: string(5) "forth" 30: [4]=> 31: string(5) "fifth" 32: }