xref: /PHP-8.3/ext/date/tests/bug75851.phpt (revision 36990aab)
1--TEST--
2Test for bug #75851: Year component overflow with date formats "c", "o", "r" and "y"
3--SKIPIF--
4<?php if (PHP_INT_SIZE != 8) die("skip 64-bit only"); ?>
5--INI--
6date.timezone = UTC
7--FILE--
8<?php
9echo date(DATE_ATOM."\n".DATE_RFC2822."\nc\nr\no\ny\nY\nU\n\n", PHP_INT_MIN);
10echo date(DATE_ATOM."\n".DATE_RFC2822."\nc\nr\no\ny\nY\nU\n\n", 67767976233532799);
11echo date(DATE_ATOM."\n".DATE_RFC2822."\nc\nr\no\ny\nY\nU\n\n", 67767976233532800);
12echo date(DATE_ATOM."\n".DATE_RFC2822."\nc\nr\no\ny\nY\nU\n\n", PHP_INT_MAX);
13?>
14--EXPECT--
15-292277022657-01-27T08:29:52+00:00
16Sun, 27 Jan -292277022657 08:29:52 +0000
17-292277022657-01-27T08:29:52+00:00
18Sun, 27 Jan -292277022657 08:29:52 +0000
19-292277022657
20-57
21-292277022657
22-9223372036854775808
23
242147483647-12-31T23:59:59+00:00
25Tue, 31 Dec 2147483647 23:59:59 +0000
262147483647-12-31T23:59:59+00:00
27Tue, 31 Dec 2147483647 23:59:59 +0000
282147483648
2947
302147483647
3167767976233532799
32
332147483648-01-01T00:00:00+00:00
34Wed, 01 Jan 2147483648 00:00:00 +0000
352147483648-01-01T00:00:00+00:00
36Wed, 01 Jan 2147483648 00:00:00 +0000
372147483648
3848
392147483648
4067767976233532800
41
42292277026596-12-04T15:30:07+00:00
43Sun, 04 Dec 292277026596 15:30:07 +0000
44292277026596-12-04T15:30:07+00:00
45Sun, 04 Dec 292277026596 15:30:07 +0000
46292277026596
4796
48292277026596
499223372036854775807
50