Annotation of embedaddon/php/ext/standard/tests/array/array_intersect_assoc_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test array_intersect_assoc() function : error conditions(Bug#43197)
3: --FILE--
4: <?php
5: /* Prototype : array array_intersect_assoc(array $arr1, array $arr2 [, array $...])
6: * Description: Returns the entries of arr1 that have values which are present in all the other arguments.
7: * Keys are used to do more restrictive check
8: * Source code: ext/standard/array.c
9: */
10:
11: echo "*** Testing array_intersect_assoc() : error conditions ***\n";
12:
13: // Zero arguments
14: echo "\n-- Testing array_intersect_assoc() function with Zero arguments --\n";
15: var_dump( array_intersect_assoc() );
16:
17: // Testing array_intersect_assoc with one less than the expected number of arguments
18: echo "\n-- Testing array_intersect_assoc() function with less than expected no. of arguments --\n";
19: $arr1 = array(1, 2);
20: var_dump( array_intersect_assoc($arr1) );
21:
22: echo "Done";
23: ?>
24: --EXPECTF--
25: *** Testing array_intersect_assoc() : error conditions ***
26:
27: -- Testing array_intersect_assoc() function with Zero arguments --
28:
29: Warning: array_intersect_assoc(): at least 2 parameters are required, 0 given in %s on line %d
30: NULL
31:
32: -- Testing array_intersect_assoc() function with less than expected no. of arguments --
33:
34: Warning: array_intersect_assoc(): at least 2 parameters are required, 1 given in %s on line %d
35: NULL
36: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>