1--TEST--
2DatePeriod: Test getter
3--INI--
4date.timezone=UTC
5--FILE--
6<?php
7$start = new DateTime('2000-01-01 00:00:00', new DateTimeZone('Europe/Berlin'));
8$end   = new DateTime('2000-01-31 00:00:00', new DateTimeZone('UTC'));
9$interval = new DateInterval('P1D');
10$period   = new DatePeriod($start, $interval, $end);
11$recurrences = 4;
12
13var_dump($period->getStartDate()->format('Y-m-d H:i:s'));
14var_dump($period->getStartDate()->getTimeZone()->getName());
15
16var_dump($period->getEndDate()->format('Y-m-d H:i:s'));
17var_dump($period->getEndDate()->getTimeZone()->getName());
18
19var_dump($period->getDateInterval()->format('%R%y-%m-%d-%h-%i-%s'));
20var_dump($period->getRecurrences());
21
22$periodWithRecurrences = new DatePeriod($start, $interval, $recurrences);
23
24var_dump($periodWithRecurrences->getRecurrences());
25var_dump($periodWithRecurrences->getEndDate());
26
27$periodWithRecurrencesWithoutStart = new DatePeriod($start, $interval, $recurrences, DatePeriod::EXCLUDE_START_DATE);
28
29var_dump($periodWithRecurrences->getRecurrences());
30
31?>
32--EXPECTF--
33string(19) "2000-01-01 00:00:00"
34string(13) "Europe/Berlin"
35string(19) "2000-01-31 00:00:00"
36string(3) "UTC"
37string(12) "+0-0-1-0-0-0"
38NULL
39int(4)
40NULL
41int(4)
42