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