blob: 493ba92dd6a0e81643eb69423abc845f3c41d7e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
--TEST--
Bug #73294: DateTime wrong when date string is negative
--FILE--
<?php
for ( $i = -1050; $i <= -1000; $i++ )
{
$M = "06";
$D = "22";
$dt = new DateTime("{$i}-{$M}-{$D} 00:00:00");
$expected = "{$i}-{$M}-{$D} 00:00:00";
$result = $dt->format('Y-m-d H:i:s');
if ( $expected != $result )
{
echo "Wrong: Should have been {$expected}, was {$result}\n";
}
}
?>
==DONE==
--EXPECT--
==DONE==
|