Annotation of embedaddon/php/ext/standard/tests/array/array_unique_variation5.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test array_unique() function : usage variations - array with duplicate keys
! 3: --FILE--
! 4: <?php
! 5: /* Prototype : array array_unique(array $input)
! 6: * Description: Removes duplicate values from array
! 7: * Source code: ext/standard/array.c
! 8: */
! 9:
! 10: /*
! 11: * Testing the functionality of array_unique() by passing
! 12: * array having duplicate keys as values.
! 13: */
! 14:
! 15: echo "*** Testing array_unique() : array with duplicate keys for \$input argument ***\n";
! 16:
! 17: // initialize the array having duplicate keys
! 18: $input = array( 1 => "one", 2 => "two", 2 => "2", 3 => "three", 1 => "1", "1", "2");
! 19: var_dump( array_unique($input) );
! 20:
! 21: echo "Done";
! 22: ?>
! 23: --EXPECTF--
! 24: *** Testing array_unique() : array with duplicate keys for $input argument ***
! 25: array(3) {
! 26: [1]=>
! 27: string(1) "1"
! 28: [2]=>
! 29: string(1) "2"
! 30: [3]=>
! 31: string(5) "three"
! 32: }
! 33: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>