1--TEST--
2Test gmstrftime() function : error conditions
3--FILE--
4<?php
5/* Prototype  : string gmstrftime(string format [, int timestamp])
6 * Description: Format a GMT/UCT time/date according to locale settings
7 * Source code: ext/date/php_date.c
8 * Alias to functions:
9 */
10
11echo "*** Testing gmstrftime() : error conditions ***\n";
12
13// Zero arguments
14echo "\n-- Testing gmstrftime() function with Zero arguments --\n";
15var_dump( gmstrftime() );
16
17//Test gmstrftime with one more than the expected number of arguments
18echo "\n-- Testing gmstrftime() function with more than expected no. of arguments --\n";
19$format = '%b %d %Y %H:%M:%S';
20$timestamp = gmmktime(8, 8, 8, 8, 8, 2008);
21$extra_arg = 10;
22var_dump( gmstrftime($format, $timestamp, $extra_arg) );
23
24?>
25===DONE===
26--EXPECTF--
27*** Testing gmstrftime() : error conditions ***
28
29-- Testing gmstrftime() function with Zero arguments --
30
31Warning: gmstrftime() expects at least 1 parameter, 0 given in %s on line %d
32bool(false)
33
34-- Testing gmstrftime() function with more than expected no. of arguments --
35
36Warning: gmstrftime() expects at most 2 parameters, 3 given in %s on line %d
37bool(false)
38===DONE===
39