xref: /PHP-8.4/ext/date/tests/mktime-3-64bit.phpt (revision f8d79582)
1--TEST--
2mktime() [3] (64-bit)
3--SKIPIF--
4<?php if (PHP_INT_SIZE != 8) die("skip 64-bit only"); ?>
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, 101, 105, 110, 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--EXPECTF--
28America/Toronto
29Y:    0 - January 2000-01-01T01:01:01-0500
30Y:   69 - January 2069-01-01T01:01:01-0500
31Y:   70 - January 1970-01-01T01:01:01-0500
32Y:   71 - January 1971-01-01T01:01:01-0500
33Y:   99 - January 1999-01-01T01:01:01-0500
34Y:  100 - January 2000-01-01T01:01:01-0500
35Y:  101 - January 0101-01-01T01:01:01-0%d
36Y:  105 - January 0105-01-01T01:01:01-0%d
37Y:  110 - January 0110-01-01T01:01:01-0%d
38Y: 1900 - January 1900-01-01T01:01:01-0%d
39Y: 1901 - January 1901-01-01T01:01:01-0%d
40Y: 1902 - January 1902-01-01T01:01:01-0500
41Y: 1999 - January 1999-01-01T01:01:01-0500
42Y: 2000 - January 2000-01-01T01:01:01-0500
43Y: 2001 - January 2001-01-01T01:01:01-0500
44
45Europe/Oslo
46Y:    0 - January 2000-01-01T01:01:01+0100
47Y:   69 - January 2069-01-01T01:01:01+0100
48Y:   70 - January 1970-01-01T01:01:01+0100
49Y:   71 - January 1971-01-01T01:01:01+0100
50Y:   99 - January 1999-01-01T01:01:01+0100
51Y:  100 - January 2000-01-01T01:01:01+0100
52Y:  101 - January 0101-01-01T01:01:01+0%d
53Y:  105 - January 0105-01-01T01:01:01+0%d
54Y:  110 - January 0110-01-01T01:01:01+0%d
55Y: 1900 - January 1900-01-01T01:01:01+0%d
56Y: 1901 - January 1901-01-01T01:01:01+0%d
57Y: 1902 - January 1902-01-01T01:01:01+0100
58Y: 1999 - January 1999-01-01T01:01:01+0100
59Y: 2000 - January 2000-01-01T01:01:01+0100
60Y: 2001 - January 2001-01-01T01:01:01+0100
61