Annotation of embedaddon/php/ext/date/tests/mktime-3.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: mktime() [3] (32-bit)
3: --SKIPIF--
4: <?php echo PHP_INT_SIZE == 8 ? "skip 32-bit only" : "OK" ?>
5: --INI--
6: error_reporting=2047
7: --FILE--
8: <?php
9: $tzs = array("America/Toronto", "Europe/Oslo");
10: $years = array(0, 69, 70, 71, 99, 100, 105, 1900, 1901, 1902, 1999, 2000, 2001);
11:
12: foreach ($tzs as $tz) {
13: echo $tz, "\n";
14: date_default_timezone_set($tz);
15: foreach ($years as $year) {
16: printf("Y: %4d - ", $year);
17: $ret = mktime(1, 1, 1, 1, 1, $year);
18: if ($ret == FALSE) {
19: echo "out of range\n";
20: } else {
21: echo date("F ".DATE_ISO8601, $ret), "\n";
22: }
23: }
24: echo "\n";
25: }
26: ?>
27: ===Done===
28: --EXPECT--
29: America/Toronto
30: Y: 0 - January 2000-01-01T01:01:01-0500
31: Y: 69 - out of range
32: Y: 70 - January 1970-01-01T01:01:01-0500
33: Y: 71 - January 1971-01-01T01:01:01-0500
34: Y: 99 - January 1999-01-01T01:01:01-0500
35: Y: 100 - January 2000-01-01T01:01:01-0500
36: Y: 105 - out of range
37: Y: 1900 - out of range
38: Y: 1901 - out of range
39: Y: 1902 - January 1902-01-01T01:01:01-0500
40: Y: 1999 - January 1999-01-01T01:01:01-0500
41: Y: 2000 - January 2000-01-01T01:01:01-0500
42: Y: 2001 - January 2001-01-01T01:01:01-0500
43:
44: Europe/Oslo
45: Y: 0 - January 2000-01-01T01:01:01+0100
46: Y: 69 - out of range
47: Y: 70 - January 1970-01-01T01:01:01+0100
48: Y: 71 - January 1971-01-01T01:01:01+0100
49: Y: 99 - January 1999-01-01T01:01:01+0100
50: Y: 100 - January 2000-01-01T01:01:01+0100
51: Y: 105 - out of range
52: Y: 1900 - out of range
53: Y: 1901 - out of range
54: Y: 1902 - January 1902-01-01T01:01:01+0100
55: Y: 1999 - January 1999-01-01T01:01:01+0100
56: Y: 2000 - January 2000-01-01T01:01:01+0100
57: Y: 2001 - January 2001-01-01T01:01:01+0100
58:
59: ===Done===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>