Annotation of embedaddon/php/ext/date/tests/bug52668.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #52668 (Iterating over a dateperiod twice is broken)
! 3: --INI--
! 4: date.timezone=UTC
! 5: --FILE--
! 6: <?php
! 7: $start = new DateTime('20101212');
! 8: $interval = DateInterval::createFromDateString('next day');
! 9: $dp = new DatePeriod($start, $interval, 1);
! 10: foreach($dp as $dt) {
! 11: echo $dt->format('r') . "\n"; // Sun, 12 Dec 2010 00:00:00 +0100
! 12: }
! 13: echo $start->format('r'), "\n";
! 14: foreach($dp as $dt) {
! 15: echo $dt->format('r') . "\n"; // Sun, 12 Dec 2010 00:00:00 +0100
! 16: }
! 17: echo $start->format('r'), "\n\n";
! 18: ?>
! 19: --EXPECT--
! 20: Sun, 12 Dec 2010 00:00:00 +0000
! 21: Mon, 13 Dec 2010 00:00:00 +0000
! 22: Sun, 12 Dec 2010 00:00:00 +0000
! 23: Sun, 12 Dec 2010 00:00:00 +0000
! 24: Mon, 13 Dec 2010 00:00:00 +0000
! 25: Sun, 12 Dec 2010 00:00:00 +0000
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>