|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64157 DateTime::createFromFormat() reports confusing error message
Submitted: 2013-02-05 14:09 UTC Modified: -
Avg. Score:2.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: thefox at neonus dot sk Assigned:
Status: Closed Package: Date/time related
PHP Version: 5.3.21 OS: Linux
Private report: No CVE-ID:
 [2013-02-05 14:09 UTC] thefox at neonus dot sk
Parsing invalid, single-digit input, for seconds using the 's' format reports confusing and incorrect error message: "A two second minute could not be found" caused probably by copying the error message for minutes ("A two digit minute could not be found") but replacing wrong word with "second".

Actually experienced in 5.3.10 but the error message is present also in the source code for 5.3.21 (I can't get my hands on this version).

Test script:
DateTime::createFromFormat('s', '0');
$lastErrors = DateTime::getLastErrors();

Expected result:
    [0] => A two digit second could not be found

Actual result:
    [0] => A two second minute could not be found


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-16 21:36 UTC]
Automatic comment on behalf of dsp
Log: News for bugfix #64157
 [2013-09-16 21:36 UTC]
-Status: Open +Status: Closed
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 23 09:02:23 2014 UTC