diff options
Diffstat (limited to 'ext/standard/tests/array/compact_error.phpt')
-rw-r--r-- | ext/standard/tests/array/compact_error.phpt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ext/standard/tests/array/compact_error.phpt b/ext/standard/tests/array/compact_error.phpt new file mode 100644 index 0000000..a7ef545 --- /dev/null +++ b/ext/standard/tests/array/compact_error.phpt @@ -0,0 +1,31 @@ +--TEST-- +Test compact() function : error conditions +--FILE-- +<?php +/* Prototype : proto array compact(mixed var_names [, mixed ...]) + * Description: Creates a hash containing variables and their values + * Source code: ext/standard/array.c + * Alias to functions: + */ + +/* + * Error -tests test compact with zero arguments. + */ + +echo "*** Testing compact() : error conditions ***\n"; + +// Zero arguments +echo "\n-- Testing compact() function with Zero arguments --\n"; +var_dump( compact() ); + + +echo "Done"; +?> +--EXPECTF-- +*** Testing compact() : error conditions *** + +-- Testing compact() function with Zero arguments -- + +Warning: compact() expects at least 1 parameter, 0 given in %s on line %d +NULL +Done |