diff options
| author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
|---|---|---|
| committer | <> | 2013-04-03 16:25:08 +0000 |
| commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
| tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/date/tests/bug46874.phpt | |
| download | php2-master.tar.gz | |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/date/tests/bug46874.phpt')
| -rw-r--r-- | ext/date/tests/bug46874.phpt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ext/date/tests/bug46874.phpt b/ext/date/tests/bug46874.phpt new file mode 100644 index 0000000..ee3546e --- /dev/null +++ b/ext/date/tests/bug46874.phpt @@ -0,0 +1,31 @@ +--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 |
