File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / date / tests / bug46874.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:53 2012 UTC (12 years, 6 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--TEST--
Bug #46874 (DatePeriod not resetting after foreach loop)
--FILE--
<?php
$dp = new DatePeriod('R5/2008-03-01T13:00:00Z/P1Y2M10DT2H30M');

foreach ($dp as $date) {
    echo $date->format("Y-m-d H:i:s\n");
}

echo "\n";

// this should repeat the same range
foreach ($dp as $date) {
    echo $date->format("Y-m-d H:i:s\n");
}
?>
--EXPECT--
2008-03-01 13:00:00
2009-05-11 15:30:00
2010-07-21 18:00:00
2011-10-01 20:30:00
2012-12-11 23:00:00
2014-02-22 01:30:00

2008-03-01 13:00:00
2009-05-11 15:30:00
2010-07-21 18:00:00
2011-10-01 20:30:00
2012-12-11 23:00:00
2014-02-22 01:30:00

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>