PageRenderTime 41ms CodeModel.GetById 20ms app.highlight 2ms RepoModel.GetById 18ms app.codeStats 0ms

/hphp/test/zend/good/ext/standard/tests/array/array_unique_variation5.php

http://github.com/facebook/hiphop-php
PHP | 19 lines | 7 code | 3 blank | 9 comment | 1 complexity | 58852131ac43e8cded95de2552147b9b MD5 | raw file
 1<?hh
 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 duplicate keys as values.
10*/
11<<__EntryPoint>> function main(): void {
12echo "*** Testing array_unique() : array with duplicate keys for \$input argument ***\n";
13
14// initialize the array having duplicate keys
15$input = darray[1 => "one", 2 => "two", 2 => "2", 3 => "three", 1 => "1", 4 => "1", 5 => "2"];
16var_dump( array_unique($input) );
17
18echo "Done";
19}