1--TEST--
2Test array_unique() function : usage variations - array with reference variables
3--FILE--
4<?php
5/*
6 * Testing the functionality of array_unique() by passing
7 * array having reference variables as values.
8*/
9
10echo "*** Testing array_unique() : array with reference variables for \$input argument ***\n";
11
12$value1 = 10;
13$value2 = "hello";
14$value3 = 0;
15$value4 = &$value2;
16
17// input array containing elements as reference variables
18$input = array(
19  0 => 0,
20  1 => &$value4,
21  2 => &$value2,
22  3 => "hello",
23  4 => &$value3,
24  5 => $value4
25);
26
27var_dump( array_unique($input, SORT_STRING) );
28
29echo "Done";
30?>
31--EXPECT--
32*** Testing array_unique() : array with reference variables for $input argument ***
33array(2) {
34  [0]=>
35  int(0)
36  [1]=>
37  &string(5) "hello"
38}
39Done
40