xref: /PHP-5.6/ext/date/tests/bug41844.phpt (revision 4b64dbb9)
1--TEST--
2Bug #41844 (Format returns incorrect number of digits for negative years -0001 to -0999)
3--FILE--
4<?php
5date_default_timezone_set("UTC");
6
7$date = new DateTime('2007-06-28');
8$date->modify('-3006 years');
9echo $date->format(DATE_ISO8601), "\n";
10
11$date = new DateTime('2007-06-28');
12$date->modify('-2008 years');
13echo $date->format(DATE_ISO8601), "\n";
14?>
15--EXPECT--
16-0999-06-28T00:00:00+0000
17-0001-06-28T00:00:00+0000
18