php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #68444 Change in method signature since 5.5
Submitted: 2014-11-18 12:19 UTC Modified: 2014-11-18 14:40 UTC
From: robert at idacmedia dot com Assigned: salathe (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.5.19 OS: n/a
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: robert at idacmedia dot com
New email:
PHP Version: OS:

 

 [2014-11-18 12:19 UTC] robert at idacmedia dot com
Description:
------------
---
From manual page: http://www.php.net/dateperiod.construct
---

As the supplied code snippet works without errors I'd suggest the method signature for the DatePeriod constructor is actually (since v5.5):

public DatePeriod::__construct ( DateTimeInterface $start , DateInterval $interval , int $recurrences [, int $options ] )
public DatePeriod::__construct ( DateTimeInterface $start , DateInterval $interval , DateTimeInterface $end [, int $options ] )
public DatePeriod::__construct ( string $isostr [, int $options ] )

Test script:
---------------
new DatePeriod(new DateTimeImmutable('2015-01-01'), new DateInterval('P1D'), 0);
new DatePeriod(new DateTimeImmutable('2015-01-01'), new DateInterval('P1D'), new DateTimeImmutable('2015-01-02'));


Expected result:
----------------
An error would be expected if the manual was correct.

Actual result:
--------------
No error - DatePeriod object is created.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-18 14:39 UTC] salathe@php.net
Automatic comment from SVN on behalf of salathe
Revision: http://svn.php.net/viewvc/?view=revision&revision=335194
Log: DatePeriod hints DateTimeInterface (doc bug #68444)
 [2014-11-18 14:40 UTC] salathe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: salathe
 [2014-11-18 14:40 UTC] salathe@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

Fixed the prototypes and added a changelog section.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 17:00:02 2026 UTC