PageRenderTime 81ms CodeModel.GetById 40ms app.highlight 1ms RepoModel.GetById 39ms app.codeStats 0ms

/hphp/test/zend/bad/ext/standard/tests/array/array_unique_variation6.php

http://github.com/facebook/hiphop-php
PHP | 32 lines | 17 code | 6 blank | 9 comment | 1 complexity | 9590165136420bde4c33f6ee8c2a2b5b MD5 | raw file
 1<?php
 2/* Prototype  : array array_unique(array $input)
 3 * Description: Removes duplicate values from array 
 4 * Source code: ext/standard/array.c
 5*/
 6
 7/*
 8 * Testing the functionality of array_unique() by passing 
 9 * array having reference variables as values.
10*/
11
12echo "*** Testing array_unique() : array with reference variables for \$input argument ***\n";
13
14$value1 = 10;
15$value2 = "hello";
16$value3 = 0;
17$value4 = &$value2;
18
19// input array containing elements as reference variables
20$input = array(
21  0 => 0,
22  1 => &$value4,
23  2 => &$value2,
24  3 => "hello",
25  4 => &$value3,
26  5 => $value4
27);
28
29var_dump( array_unique($input, SORT_STRING) );
30
31echo "Done";
32?>