xref: /PHP-7.0/ext/date/tests/strftime_error.phpt (revision 5b75dd31)
1--TEST--
2Test strftime() function : error conditions
3--FILE--
4<?php
5/* Prototype  : string strftime(string format [, int timestamp])
6 * Description: Format a local time/date according to locale settings
7 * Source code: ext/date/php_date.c
8 * Alias to functions:
9 */
10
11echo "*** Testing strftime() : error conditions ***\n";
12
13date_default_timezone_set("Asia/Calcutta");
14//Test strftime with one more than the expected number of arguments
15echo "\n-- Testing strftime() function with more than expected no. of arguments --\n";
16$format = '%b %d %Y %H:%M:%S';
17$timestamp = mktime(8, 8, 8, 8, 8, 2008);
18$extra_arg = 10;
19var_dump( strftime($format, $timestamp, $extra_arg) );
20
21?>
22===DONE===
23--EXPECTF--
24*** Testing strftime() : error conditions ***
25
26-- Testing strftime() function with more than expected no. of arguments --
27
28Warning: strftime() expects at most 2 parameters, 3 given in %s on line %d
29bool(false)
30===DONE===
31