1--TEST--
2Test date_default_timezone_set() function : error variations
3--FILE--
4<?php
5/* Prototype  : bool date_default_timezone_set ( string $timezone_identifier )
6 * Description:  Sets the default timezone used by all date/time functions in a script.
7 * Source code: ext/standard/data/php_date.c
8 */
9
10echo "*** Testing date_default_timezone_set() : error variations ***\n";
11
12echo "\n-- Testing date_default_timezone_set() function with less than expected no. of arguments --\n";
13var_dump( date_default_timezone_set() );
14
15echo "\n-- Testing date_default_timezone_set() function with more than expected no. of arguments --\n";
16$extra_arg = 10;
17var_dump( date_default_timezone_set("GMT", $extra_arg) );
18
19echo "\n-- Testing date_default_timezone_set() function with invalid timezone identifier  --\n";
20var_dump( date_default_timezone_set("foo") );
21
22?>
23===Done===
24--EXPECTF--
25*** Testing date_default_timezone_set() : error variations ***
26
27-- Testing date_default_timezone_set() function with less than expected no. of arguments --
28
29Warning: date_default_timezone_set() expects exactly 1 parameter, 0 given in %s on line %d
30bool(false)
31
32-- Testing date_default_timezone_set() function with more than expected no. of arguments --
33
34Warning: date_default_timezone_set() expects exactly 1 parameter, 2 given in %s on line %d
35bool(false)
36
37-- Testing date_default_timezone_set() function with invalid timezone identifier  --
38
39Notice: date_default_timezone_set(): Timezone ID 'foo' is invalid in %s on line %d
40bool(false)
41===Done===
42