|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #62486 Missing documentation for DatePeriod
Submitted: 2012-07-05 19:16 UTC Modified: 2012-07-20 09:40 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: logos-php at kith dot org Assigned: aharvey (profile)
Status: Closed Package: Date/time related
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: logos-php at kith dot org
New email:
PHP Version: OS:


 [2012-07-05 19:16 UTC] logos-php at kith dot org
From manual page:
The DatePeriod page doesn't give any information that I can find about the class 
of the objects that result from iterating over it.

In particular, as far as I can tell, if you do a foreach on a DatePeriod, the 
instances of the iterator are DateTime objects. Which is great--it's exactly what 
I wanted--but it doesn't appear to be documented.

Perhaps it's obvious to people who know more about iterators. But for me, I had 
to figure it out by reading people's posts, and confirm it by reading this Stack 
Overflow answer: (

More generally, the DatePeriod page doesn't really explain at all what a 
DatePeriod is or how to use it. Fortunately, the user-supplied examples help a 
lot with that.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-07-20 09:39 UTC]
Automatic comment from SVN on behalf of aharvey
Log: Fix doc bug #62486 (Missing documentation for DatePeriod).
 [2012-07-20 09:39 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: aharvey
 [2012-07-20 09:39 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

 [2012-07-20 09:40 UTC]
Wrong quick fix, but you get the idea. Expect improved DatePeriod documentation soon. :)
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 28 11:01:32 2024 UTC