php.net |  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
Votes:1
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: logos-php at kith dot org
New email:
PHP Version: OS:

 

 [2012-07-05 19:16 UTC] logos-php at kith dot org
Description:
------------
---
From manual page: http://www.php.net/class.dateperiod
---
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: (http://stackoverflow.com/questions/3416288/parameterizing-php-
code-with-dateperiod-dateinterval-classes)

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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-07-20 09:39 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=326735
Log: Fix doc bug #62486 (Missing documentation for DatePeriod).
 [2012-07-20 09:39 UTC] aharvey@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: aharvey
 [2012-07-20 09:39 UTC] aharvey@php.net
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
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-07-20 09:40 UTC] aharvey@php.net
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: Fri Apr 19 18:01:28 2024 UTC