Skip to content

Commit 9fbc798

Browse files
author
Derick Rethans
committed
- Added a test case for bug #46268. (Bug itself is not present in 5.2).
1 parent 444aba4 commit 9fbc798

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

ext/date/tests/bug46268.phpt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--TEST--
2+
Bug #46268 (When call DateTime#setTime, it seems to be called the last modify method too)
3+
--FILE--
4+
<?php
5+
date_default_timezone_set('Asia/Tokyo');
6+
7+
$now = new DateTime('2008-10-10 01:02:03');
8+
echo $now->format("Y-m-d H:i:s") . PHP_EOL;
9+
10+
$now->modify("1 day after");
11+
echo $now->format("Y-m-d H:i:s") . PHP_EOL;
12+
13+
$now->modify("1 hour after");
14+
echo $now->format("Y-m-d H:i:s") . PHP_EOL;
15+
16+
$now->setTime(0, 0, 0);
17+
//date_time_set($now, 0, 0, 0);
18+
echo $now->format("Y-m-d H:i:s") . PHP_EOL;
19+
--EXPECT--
20+
2008-10-10 01:02:03
21+
2008-10-11 01:02:03
22+
2008-10-11 02:02:03
23+
2008-10-11 00:00:00

0 commit comments

Comments
 (0)