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

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 ***
1.1.1.2 ! misho      31: 
        !            32: Notice: Array to string conversion in %sarray_unique_variation8.php on line %d
        !            33: 
        !            34: Notice: Array to string conversion in %sarray_unique_variation8.php on line %d
        !            35: 
        !            36: Notice: Array to string conversion in %sarray_unique_variation8.php on line %d
        !            37: 
        !            38: Notice: Array to string conversion in %sarray_unique_variation8.php on line %d
        !            39: 
        !            40: Notice: Array to string conversion in %sarray_unique_variation8.php on line %d
        !            41: 
        !            42: Notice: Array to string conversion in %sarray_unique_variation8.php on line %d
        !            43: 
        !            44: Notice: Array to string conversion in %sarray_unique_variation8.php on line %d
        !            45: 
        !            46: Notice: Array to string conversion in %sarray_unique_variation8.php on line %d
        !            47: 
        !            48: Notice: Array to string conversion in %sarray_unique_variation8.php on line %d
        !            49: 
        !            50: Notice: Array to string conversion in %sarray_unique_variation8.php on line %d
        !            51: 
        !            52: Notice: Array to string conversion in %sarray_unique_variation8.php on line %d
        !            53: 
        !            54: Notice: Array to string conversion in %sarray_unique_variation8.php on line %d
        !            55: 
        !            56: Notice: Array to string conversion in %sarray_unique_variation8.php on line %d
        !            57: 
        !            58: Notice: Array to string conversion in %sarray_unique_variation8.php on line %d
1.1       misho      59: array(1) {
                     60:   [0]=>
                     61:   array(4) {
                     62:     [0]=>
                     63:     int(1)
                     64:     [1]=>
                     65:     int(2)
                     66:     [2]=>
                     67:     int(3)
                     68:     [3]=>
                     69:     int(1)
                     70:   }
                     71: }
                     72: Done

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