xref: /PHP-5.4/ext/date/tests/mktime-3.phpt (revision c70c7ca7)
1--TEST--
2mktime() [3] (32-bit)
3--SKIPIF--
4<?php echo PHP_INT_SIZE == 8 ? "skip 32-bit only" : "OK" ?>
5--INI--
6error_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
12foreach ($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--
29America/Toronto
30Y:    0 - January 2000-01-01T01:01:01-0500
31Y:   69 - out of range
32Y:   70 - January 1970-01-01T01:01:01-0500
33Y:   71 - January 1971-01-01T01:01:01-0500
34Y:   99 - January 1999-01-01T01:01:01-0500
35Y:  100 - January 2000-01-01T01:01:01-0500
36Y:  105 - out of range
37Y: 1900 - out of range
38Y: 1901 - out of range
39Y: 1902 - January 1902-01-01T01:01:01-0500
40Y: 1999 - January 1999-01-01T01:01:01-0500
41Y: 2000 - January 2000-01-01T01:01:01-0500
42Y: 2001 - January 2001-01-01T01:01:01-0500
43
44Europe/Oslo
45Y:    0 - January 2000-01-01T01:01:01+0100
46Y:   69 - out of range
47Y:   70 - January 1970-01-01T01:01:01+0100
48Y:   71 - January 1971-01-01T01:01:01+0100
49Y:   99 - January 1999-01-01T01:01:01+0100
50Y:  100 - January 2000-01-01T01:01:01+0100
51Y:  105 - out of range
52Y: 1900 - out of range
53Y: 1901 - out of range
54Y: 1902 - January 1902-01-01T01:01:01+0100
55Y: 1999 - January 1999-01-01T01:01:01+0100
56Y: 2000 - January 2000-01-01T01:01:01+0100
57Y: 2001 - January 2001-01-01T01:01:01+0100
58
59===Done===