xref: /PHP-5.3/ext/date/tests/getdate_error.phpt (revision 023db079)
1--TEST--
2Test getdate() function : error conditions
3--FILE--
4<?php
5/* Prototype  : array getdate([int timestamp])
6 * Description: Get date/time information
7 * Source code: ext/date/php_date.c
8 * Alias to functions:
9 */
10
11echo "*** Testing getdate() : error conditions ***\n";
12
13//Set the default time zone
14date_default_timezone_set("America/Chicago");
15
16//Test getdate with one more than the expected number of arguments
17echo "\n-- Testing getdate() function with more than expected no. of arguments --\n";
18$timestamp = 10;
19$extra_arg = 10;
20var_dump( getdate($timestamp, $extra_arg) );
21
22?>
23===DONE===
24--EXPECTF--
25*** Testing getdate() : error conditions ***
26
27-- Testing getdate() function with more than expected no. of arguments --
28
29Warning: getdate() expects at most 1 parameter, 2 given in %s on line %d
30bool(false)
31===DONE===
32