Annotation of embedaddon/php/ext/date/tests/bug46874.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #46874 (DatePeriod not resetting after foreach loop)
! 3: --FILE--
! 4: <?php
! 5: $dp = new DatePeriod('R5/2008-03-01T13:00:00Z/P1Y2M10DT2H30M');
! 6:
! 7: foreach ($dp as $date) {
! 8: echo $date->format("Y-m-d H:i:s\n");
! 9: }
! 10:
! 11: echo "\n";
! 12:
! 13: // this should repeat the same range
! 14: foreach ($dp as $date) {
! 15: echo $date->format("Y-m-d H:i:s\n");
! 16: }
! 17: ?>
! 18: --EXPECT--
! 19: 2008-03-01 13:00:00
! 20: 2009-05-11 15:30:00
! 21: 2010-07-21 18:00:00
! 22: 2011-10-01 20:30:00
! 23: 2012-12-11 23:00:00
! 24: 2014-02-22 01:30:00
! 25:
! 26: 2008-03-01 13:00:00
! 27: 2009-05-11 15:30:00
! 28: 2010-07-21 18:00:00
! 29: 2011-10-01 20:30:00
! 30: 2012-12-11 23:00:00
! 31: 2014-02-22 01:30:00
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>