xref: /PHP-5.5/ext/date/tests/bug39782.phpt (revision 2f291233)
1--TEST--
2Bug #39782 (setTime() on a DateTime constructed with a Weekday yields incorrect results)
3--FILE--
4<?php
5date_default_timezone_set("GMT");
6
7$dttTest = new DateTime('Dec 10 2006 Next Wednesday');
8echo $dttTest->format('D M j Y - H:i:s') . "\n";
9
10$dttTest->setTime(12, 0, 0);
11echo $dttTest->format('D M j Y - H:i:s') . "\n";
12
13$dttTest->setTime(12, 0, 0);
14echo $dttTest->format('D M j Y - H:i:s') . "\n";
15?>
16--EXPECT--
17Wed Dec 13 2006 - 00:00:00
18Wed Dec 13 2006 - 12:00:00
19Wed Dec 13 2006 - 12:00:00