php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #69380 Insufficient "Date Format" example in online documentation
Submitted: 2015-04-05 20:07 UTC Modified: 2016-05-19 21:36 UTC
From: php at christian-stuedemann dot de Assigned: salathe (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.6.8RC1 OS: all
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: php at christian-stuedemann dot de
New email:
PHP Version: OS:

 

 [2015-04-05 20:07 UTC] php at christian-stuedemann dot de
Description:
------------
---
From manual page: http://www.php.net/datetime.formats.date
---

In "Localized Notations" the 7th line says >>Day, month and two digit year, with dots or tabs 	dd [.\t] mm "." yy 	"30.6.08", "22\t12\t78"<<
The last example "22\t12\t78" does not match to the RegExp and is not accepted by the DateTime constructor (which is correct, but the example is not). The second tab must be a dot to meet the RegExp: "22\t12.78"
Implementation seems to be correct, but documentation/example must be maintained.

Test script:
---------------
function testDateTimeExample() {
    $mustBeValid = new DateTime("22\t12.78");
    try {
        $isInvalid = new DateTime("22\t12\t78");
    }catch(Exception $e){
        // log $e
    }
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-08 13:47 UTC] salathe@php.net
-Assigned To: +Assigned To: salathe
 [2016-05-19 21:35 UTC] salathe@php.net
Automatic comment from SVN on behalf of salathe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=339186
Log: fix invalid date format examples (doc #69380)
 [2016-05-19 21:36 UTC] salathe@php.net
-Status: Assigned +Status: Closed
 [2016-05-19 21:36 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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 05:01:29 2024 UTC