diff --git a/ext/date/tests/bug78055.phpt b/ext/date/tests/bug78055.phpt new file mode 100644 index 00000000000..0ad252793f4 --- /dev/null +++ b/ext/date/tests/bug78055.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #78055 (DatePeriod's getRecurrences and ->recurrences don't match) +--FILE-- +getRecurrences(), " ", $period->recurrences, "\n"; + +$period = new DatePeriod($start, $interval, $recurrences); +echo $period->getRecurrences(), " ", $period->recurrences, "\n"; + +$period = new DatePeriod($start, $interval, $recurrences, DatePeriod::INCLUDE_END_DATE); +echo $period->getRecurrences(), " ", $period->recurrences, "\n"; + +$period = new DatePeriod($start, $interval, $end); +echo $period->getRecurrences(), " ", $period->recurrences, "\n"; + +$period = new DatePeriod($start, $interval, $end, DatePeriod::EXCLUDE_START_DATE); +echo $period->getRecurrences(), " ", $period->recurrences, "\n"; +?> +--EXPECT-- +5 5 +5 6 +5 7 + 1 + 0