Annotation of embedaddon/php/ext/standard/tests/array/compact_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test compact() function : error conditions
3: --FILE--
4: <?php
5: /* Prototype : proto array compact(mixed var_names [, mixed ...])
6: * Description: Creates a hash containing variables and their values
7: * Source code: ext/standard/array.c
8: * Alias to functions:
9: */
10:
11: /*
12: * Error -tests test compact with zero arguments.
13: */
14:
15: echo "*** Testing compact() : error conditions ***\n";
16:
17: // Zero arguments
18: echo "\n-- Testing compact() function with Zero arguments --\n";
19: var_dump( compact() );
20:
21:
22: echo "Done";
23: ?>
24: --EXPECTF--
25: *** Testing compact() : error conditions ***
26:
27: -- Testing compact() function with Zero arguments --
28:
29: Warning: compact() expects at least 1 parameter, 0 given in %s on line %d
30: NULL
31: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>