]> granicus.if.org Git - php/commitdiff
Added test
authorDmitry Stogov <dmitry@php.net>
Tue, 12 Oct 2010 07:38:36 +0000 (07:38 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 12 Oct 2010 07:38:36 +0000 (07:38 +0000)
Zend/tests/bug52939.phpt [new file with mode: 0644]

diff --git a/Zend/tests/bug52939.phpt b/Zend/tests/bug52939.phpt
new file mode 100644 (file)
index 0000000..9810b80
--- /dev/null
@@ -0,0 +1,28 @@
+--TEST--
+Bug #52939 (zend_call_function_array does not respect ZEND_SEND_PREFER_REF)
+--FILE--
+<?php
+$ar1 = array("row1" => 2, "row2" => 1);
+var_dump(array_multisort($ar1));
+var_dump($ar1);
+
+$ar1 = array("row1" => 2, "row2" => 1);
+$args = array(&$ar1);
+var_dump(call_user_func_array("array_multisort", $args));
+var_dump($ar1);
+?>
+--EXPECT--
+bool(true)
+array(2) {
+  ["row2"]=>
+  int(1)
+  ["row1"]=>
+  int(2)
+}
+bool(true)
+array(2) {
+  ["row2"]=>
+  int(1)
+  ["row1"]=>
+  int(2)
+}