xref: /PHP-5.3/ext/date/tests/mktime-2.phpt (revision 2a0343fb)
1--TEST--
2mktime() [2]
3--INI--
4error_reporting=2047
5--FILE--
6<?php
7$timezones = array(
8    'UTC',
9    'Europe/London'
10);
11
12foreach($timezones as $timezone)
13{
14    date_default_timezone_set($timezone);
15
16    /* status of daylight saving time unknown */
17    var_dump(mktime(0, 0, 0, 1, 1, 2002));
18    /* status of daylight saving time unknown */
19    var_dump(mktime(0, 0, 0, 1, 1, 2002, -1));
20    /* daylight saving time is not in effect */
21    var_dump(mktime(0, 0, 0, 1, 1, 2002, 0));
22    /* daylight saving time is in effect */
23    var_dump(mktime(0, 0, 0, 1, 1, 2002, 1));
24
25    /* status of daylight saving time unknown */
26    var_dump(mktime(0, 0, 0, 7, 1, 2002));
27    /* status of daylight saving time unknown */
28    var_dump(mktime(0, 0, 0, 7, 1, 2002, -1));
29    /* daylight saving time is not in effect */
30    var_dump(mktime(0, 0, 0, 7, 1, 2002, 0));
31    /* daylight saving time is in effect */
32    var_dump(mktime(0, 0, 0, 7, 1, 2002, 1));
33}
34?>
35--EXPECTF--
36int(1009843200)
37int(1009843200)
38int(1009843200)
39int(%s)
40int(1025481600)
41int(1025481600)
42int(1025481600)
43int(%s)
44int(1009843200)
45int(1009843200)
46int(1009843200)
47int(1009839600)
48int(1025478000)
49int(1025478000)
50int(1025481600)
51int(1025478000)
52