bug25359.phpt 558 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Bug #25359 (array_multisort() does not work in a function if array is global or reference)
  3. --FILE--
  4. <?php
  5. function does_not_work()
  6. {
  7. global $data; // Remove this line to make array_multisort() work
  8. $data = array('first', 'fifth', 'second', 'forth', 'third');
  9. $sort = array(1, 5, 2, 4, 3);
  10. array_multisort($sort, $data);
  11. var_dump($data);
  12. }
  13. does_not_work();
  14. ?>
  15. --EXPECT--
  16. array(5) {
  17. [0]=>
  18. string(5) "first"
  19. [1]=>
  20. string(6) "second"
  21. [2]=>
  22. string(5) "third"
  23. [3]=>
  24. string(5) "forth"
  25. [4]=>
  26. string(5) "fifth"
  27. }