]> granicus.if.org Git - php/commitdiff
Added test for bug #25359
authorfoobar <sniper@php.net>
Sat, 30 Jul 2005 13:37:57 +0000 (13:37 +0000)
committerfoobar <sniper@php.net>
Sat, 30 Jul 2005 13:37:57 +0000 (13:37 +0000)
ext/standard/tests/array/bug25359.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/array/bug25359.phpt b/ext/standard/tests/array/bug25359.phpt
new file mode 100644 (file)
index 0000000..0b9b89a
--- /dev/null
@@ -0,0 +1,32 @@
+--TEST--
+Bug #25359 (array_multisort() does not work in a function if array is global or reference)
+--FILE--
+<?php
+
+function does_not_work()
+{
+    global $data; // Remove this line to make array_multisort() work
+
+    $data = array('first', 'fifth', 'second', 'forth', 'third');
+    $sort = array(1, 5, 2, 4, 3);
+    array_multisort($sort, $data);
+
+    var_dump($data);
+}
+
+does_not_work();
+
+?>
+--EXPECT--
+array(5) {
+  [0]=>
+  string(5) "first"
+  [1]=>
+  string(6) "second"
+  [2]=>
+  string(5) "third"
+  [3]=>
+  string(5) "forth"
+  [4]=>
+  string(5) "fifth"
+}