xref: /php-src/ext/date/tests/bug77243-001.phpt (revision b23dfe49)
1--TEST--
2Bug #77243 (Weekdays are calculated incorrectly for negative years)
3--SKIPIF--
4<?php if (PHP_INT_SIZE != 8) die("skip 64-bit only"); ?>
5--FILE--
6<?php
7date_default_timezone_set('UTC');
8
9$time=-62167046400; // 0000-01-03 0-01-1
10
11for ($i = -10; $i < 10; $i++ )
12{
13	echo date('Y-m-d o-W-N', $time + ($i * 86400)), "\n";
14}
15?>
16--EXPECT--
17-0001-12-24 -1-51-5
18-0001-12-25 -1-51-6
19-0001-12-26 -1-51-7
20-0001-12-27 -1-52-1
21-0001-12-28 -1-52-2
22-0001-12-29 -1-52-3
23-0001-12-30 -1-52-4
24-0001-12-31 -1-52-5
250000-01-01 -1-52-6
260000-01-02 -1-52-7
270000-01-03 0-01-1
280000-01-04 0-01-2
290000-01-05 0-01-3
300000-01-06 0-01-4
310000-01-07 0-01-5
320000-01-08 0-01-6
330000-01-09 0-01-7
340000-01-10 0-02-1
350000-01-11 0-02-2
360000-01-12 0-02-3
37