1--TEST--
2call_user_func_array() passes value to prefer-ref arg if element wasn't a reference
3--FILE--
4<?php
5
6namespace {
7    call_user_func_array('array_multisort', [[3, 2, 1]]);
8
9    $args = [[3, 2, 1]];
10    call_user_func_array('array_multisort', $args);
11    var_dump($args);
12    unset($args);
13
14    $array = [3, 2, 1];
15    call_user_func('array_multisort', $array);
16    var_dump($array);
17    unset($array);
18}
19
20namespace Foo {
21    call_user_func_array('array_multisort', [[3, 2, 1]]);
22
23    $args = [[3, 2, 1]];
24    call_user_func_array('array_multisort', $args);
25    var_dump($args);
26    unset($args);
27
28    $array = [3, 2, 1];
29    call_user_func('array_multisort', $array);
30    var_dump($array);
31    unset($array);
32}
33
34?>
35--EXPECT--
36array(1) {
37  [0]=>
38  array(3) {
39    [0]=>
40    int(3)
41    [1]=>
42    int(2)
43    [2]=>
44    int(1)
45  }
46}
47array(3) {
48  [0]=>
49  int(3)
50  [1]=>
51  int(2)
52  [2]=>
53  int(1)
54}
55array(1) {
56  [0]=>
57  array(3) {
58    [0]=>
59    int(3)
60    [1]=>
61    int(2)
62    [2]=>
63    int(1)
64  }
65}
66array(3) {
67  [0]=>
68  int(3)
69  [1]=>
70  int(2)
71  [2]=>
72  int(1)
73}
74