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