summaryrefslogtreecommitdiff
path: root/ext/date/tests/gmmktime_error.phpt
blob: 62e62057ea7fd06326345a017d51d98f4d08efb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--TEST--
Test gmmktime() function : error conditions 
--FILE--
<?php
/* Prototype  : int gmmktime([int hour [, int min [, int sec [, int mon [, int day [, int year]]]]]])
 * Description: Get UNIX timestamp for a GMT date 
 * Source code: ext/date/php_date.c
 * Alias to functions: 
 */

echo "*** Testing gmmktime() : error conditions ***\n";

//Test gmmktime with one more than the expected number of arguments
echo "\n-- Testing gmmktime() function with more than expected no. of arguments --\n";
$hour = 8;
$min = 8;
$sec = 8;
$mon = 8;
$day = 8;
$year = 2008;
$extra_arg = 10;

var_dump( gmmktime($hour, $min, $sec, $mon, $day, $year, $extra_arg) );
?>
===DONE===
--EXPECTF--
*** Testing gmmktime() : error conditions ***

-- Testing gmmktime() function with more than expected no. of arguments --

Warning: gmmktime() expects at most 6 parameters, 7 given in %s on line %d
bool(false)
===DONE===