8000 Add extra test case that hase both EXCLUDE_START_DATE and INCLUDE_END… · php/php-src@006aa1d · GitHub
[go: up one dir, main page]

Skip to content

Commit 006aa1d

Browse files
committed
Add extra test case that hase both EXCLUDE_START_DATE and INCLUDE_END_DATE
1 parent 68fd596 commit 006aa1d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
DatePeriod::EXCLUDE_START_DATE|DatePeriod::INCLUDE_END_DATE
3+
--FILE--
4+
<?php
5+
date_default_timezone_set('UTC');
6+
$start = new DateTime('2010-06-07');
7+
$end = new DateTime('2010-06-10');
8+
$interval = new DateInterval('P1D');
9+
10+
$dp = new DatePeriod($start, $interval, $end, DatePeriod::EXCLUDE_START_DATE | DatePeriod::INCLUDE_END_DATE);
11+
foreach ($dp as $day) {
12+
echo $day->format('Y-m-d') . "\n";
13+
}
14+
?>
15+
--EXPECT--
16+
2010-06-08
17+
2010-06-09
18+
2010-06-10
19+

0 commit comments

Comments
 (0)
0