diff options
Diffstat (limited to 'ext/standard/tests/array/array_unique_variation5.phpt')
-rw-r--r-- | ext/standard/tests/array/array_unique_variation5.phpt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/standard/tests/array/array_unique_variation5.phpt b/ext/standard/tests/array/array_unique_variation5.phpt new file mode 100644 index 0000000..5e3f7c3 --- /dev/null +++ b/ext/standard/tests/array/array_unique_variation5.phpt @@ -0,0 +1,33 @@ +--TEST-- +Test array_unique() function : usage variations - array with duplicate keys +--FILE-- +<?php +/* 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. +*/ + +echo "*** Testing array_unique() : array with duplicate keys for \$input argument ***\n"; + +// initialize the array having duplicate keys +$input = array( 1 => "one", 2 => "two", 2 => "2", 3 => "three", 1 => "1", "1", "2"); +var_dump( array_unique($input) ); + +echo "Done"; +?> +--EXPECTF-- +*** Testing array_unique() : array with duplicate keys for $input argument *** +array(3) { + [1]=> + string(1) "1" + [2]=> + string(1) "2" + [3]=> + string(5) "three" +} +Done |