xref: /PHP-7.0/ext/date/tests/gmmktime_error.phpt (revision 9c5eaac1)
1--TEST--
2Test gmmktime() function : error conditions
3--FILE--
4<?php
5/* Prototype  : int gmmktime([int hour [, int min [, int sec [, int mon [, int day [, int year]]]]]])
6 * Description: Get UNIX timestamp for a GMT date
7 * Source code: ext/date/php_date.c
8 * Alias to functions:
9 */
10
11echo "*** Testing gmmktime() : error conditions ***\n";
12
13//Test gmmktime with one more than the expected number of arguments
14echo "\n-- Testing gmmktime() function with more than expected no. of arguments --\n";
15$hour = 8;
16$min = 8;
17$sec = 8;
18$mon = 8;
19$day = 8;
20$year = 2008;
21$extra_arg = 10;
22
23var_dump( gmmktime($hour, $min, $sec, $mon, $day, $year, $extra_arg) );
24?>
25===DONE===
26--EXPECTF--
27*** Testing gmmktime() : error conditions ***
28
29-- Testing gmmktime() function with more than expected no. of arguments --
30
31Warning: gmmktime() expects at most 6 parameters, 7 given in %s on line %d
32bool(false)
33===DONE===
34