xref: /PHP-5.3/ext/date/tests/bug49585.phpt (revision 5a43f269)
1--TEST--
2Bug #49585 (date_format buffer not long enough for >4 digit years)
3--FILE--
4<?php
5date_default_timezone_set('UTC');
6
7$date = new DateTime('-1500-01-01');
8var_dump($date->format('r'));
9
10$date->setDate(-2147483648, 1, 1);
11var_dump($date->format('r'));
12var_dump($date->format('c'));
13--EXPECT--
14string(32) "Sat, 01 Jan -1500 00:00:00 +0000"
15string(42) "Unknown, 01 Jan -2147483648 00:00:00 +0000"
16string(32) "-2147483648-01-01T00:00:00+00:00"
17