1--TEST--
2Test DateTimeZone::getOffset() function : error conditions
3--FILE--
4<?php
5/* Prototype  : int DateTimeZone::getOffset  ( DateTime $datetime  )
6 * Description: Returns the timezone offset from GMT
7 * Source code: ext/date/php_date.c
8 * Alias to functions: timezone_offset_get()
9 */
10
11//Set the default time zone
12date_default_timezone_set("GMT");
13
14$tz = new DateTimeZone("Europe/London");
15$date = date_create("GMT");
16
17echo "*** Testing DateTimeZone::getOffset() : error conditions ***\n";
18
19echo "\n-- Testing DateTimeZone::getOffset() function with zero arguments --\n";
20var_dump( $tz->getOffset() );
21
22echo "\n-- Testing DateTimeZone::getOffset() function with more than expected no. of arguments --\n";
23$extra_arg = 99;
24var_dump( $tz->getOffset($date, $extra_arg) );
25
26?>
27===DONE===
28--EXPECTF--
29*** Testing DateTimeZone::getOffset() : error conditions ***
30
31-- Testing DateTimeZone::getOffset() function with zero arguments --
32
33Warning: DateTimeZone::getOffset() expects exactly 1 parameter, 0 given in %s on line %d
34bool(false)
35
36-- Testing DateTimeZone::getOffset() function with more than expected no. of arguments --
37
38Warning: DateTimeZone::getOffset() expects exactly 1 parameter, 2 given in %s on line %d
39bool(false)
40===DONE===