/hphp/test/zend/good/ext/standard/tests/array/array_unique_variation5.php
PHP | 19 lines | 7 code | 3 blank | 9 comment | 1 complexity | 58852131ac43e8cded95de2552147b9b MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?hh
- /* Prototype : array array_unique(array $input)
- * Description: Removes duplicate values from array
- * Source code: ext/standard/array.c
- */
- /*
- * Testing the functionality of array_unique() by passing
- * array having duplicate keys as values.
- */
- <<__EntryPoint>> function main(): void {
- echo "*** Testing array_unique() : array with duplicate keys for \$input argument ***\n";
- // initialize the array having duplicate keys
- $input = darray[1 => "one", 2 => "two", 2 => "2", 3 => "three", 1 => "1", 4 => "1", 5 => "2"];
- var_dump( array_unique($input) );
- echo "Done";
- }