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

1.1       misho       1: --TEST--
                      2: Test array_merge() function : error conditions - Pass incorrect number of args
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : array array_merge(array $arr1, array $arr2 [, array $...])
                      6:  * Description: Merges elements from passed arrays into one array 
                      7:  * Source code: ext/standard/array.c
                      8:  */
                      9: 
                     10: /*
                     11:  * Pass incorrect number of arguments to array_merge() to test behaviour
                     12:  */
                     13: 
                     14: echo "*** Testing array_merge() : error conditions ***\n";
                     15: 
                     16: // Testing array_merge with zero arguments
                     17: echo "\n-- Testing array_merge() function with less than expected no. of arguments --\n";
                     18: $arr1 = array(1, 2);
                     19: var_dump( array_merge() );
                     20: 
                     21: echo "Done";
                     22: ?>
                     23: --EXPECTF--
                     24: *** Testing array_merge() : error conditions ***
                     25: 
                     26: -- Testing array_merge() function with less than expected no. of arguments --
                     27: 
                     28: Warning: array_merge() expects at least 1 parameter, 0 given in %s on line %d
                     29: NULL
                     30: Done

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