Doc #72461 [NEW]: Documentation on DatePeriod is missing mention of unbounded periods
| From: | pauld at sagekey dot com | Date: | Mon, 20 Jun 2016 19:36:41 +0000 |
| Subject: | Doc #72461 [NEW]: Documentation on DatePeriod is missing mention of unbounded periods | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-13565@lists.php.net to get a copy of this message | ||
From: pauld at sagekey dot com
Operating system:
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Documentation on DatePeriod is missing mention of unbounded periods
Description:
------------
---
From manual page: http://www.php.net/class.dateperiod
---
DatePeriod does not appear to support ISO 8601 date periods without an
upper bound (e.g., 'R/2016-16-20T00:00:00Z/P7D') or null end dates. The
ISO spec itself supports this, so a note should be made in the
documentation that DatePeriod does not.
Test script:
---------------
// This throws an exception with message 'DatePeriod::__construct():
Unknown or bad format (R/2016-06-20T00:00:00Z/P7D)'
$dp1 = new DatePeriod('R/2016-06-20T00:00:00Z/P7D');
// This silently accepts the null third argument; the resulting object
has a null end date and one recurrence.
$dp = new DatePeriod(new DateTime('2016-06-20'), new
DateInterval('P7D'), null);
--
Edit bug report at https://bugs.php.net/bug.php?id=72461&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72461&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72461&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72461&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72461&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72461&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72461&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72461&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72461&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72461&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72461&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72461&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72461&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72461&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72461&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72461&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72461&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72461&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72461&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72461&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72461&r=mysqlcfg