Annotation of embedaddon/php/ext/standard/tests/array/array_unique_variation8.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test array_unique() function : usage variations - two dimensional arrays
                      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:  * two dimensional arrays for $input argument.
                     13: */
                     14: 
                     15: echo "*** Testing array_unique() : two dimensional array for \$input argument ***\n";
                     16: 
                     17: // initialize the 2-d array
                     18: $input = array( 
                     19:   array(1, 2, 3, 1),
                     20:   array("hello", "world", "str1" => "hello", "str2" => 'world'),
                     21:   array(1 => "one", 2 => "two", "one", 'two'),
                     22:   array(1, 2, 3, 1)
                     23: );
                     24: 
                     25: var_dump( array_unique($input, SORT_STRING) );
                     26: 
                     27: echo "Done";
                     28: ?>
                     29: --EXPECTF--
                     30: *** Testing array_unique() : two dimensional array for $input argument ***
                     31: array(1) {
                     32:   [0]=>
                     33:   array(4) {
                     34:     [0]=>
                     35:     int(1)
                     36:     [1]=>
                     37:     int(2)
                     38:     [2]=>
                     39:     int(3)
                     40:     [3]=>
                     41:     int(1)
                     42:   }
                     43: }
                     44: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>