PageRenderTime 52ms CodeModel.GetById 30ms app.highlight 2ms RepoModel.GetById 18ms app.codeStats 1ms

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

http://github.com/facebook/hiphop-php
PHP | 25 lines | 11 code | 5 blank | 9 comment | 1 complexity | cbcc36143c41874db9d8b2f5942ddefe 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 * two dimensional arrays for $input argument.
10*/
11
12echo "*** Testing array_unique() : two dimensional array for \$input argument ***\n";
13
14// initialize the 2-d array
15$input = array( 
16  array(1, 2, 3, 1),
17  array("hello", "world", "str1" => "hello", "str2" => 'world'),
18  array(1 => "one", 2 => "two", "one", 'two'),
19  array(1, 2, 3, 1)
20);
21
22var_dump( array_unique($input, SORT_STRING) );
23
24echo "Done";
25?>