source: src/router/php7/ext/date/tests/bug73294.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 2 months ago

update php

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