Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/date/lib/parse_date.c
Original file line number Diff line number Diff line change
Expand Up @@ -25002,7 +25002,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
TIMELIB_CHECK_NUMBER;
sec = timelib_get_nr_ex((char **) &ptr, 2, &length);
if (sec == TIMELIB_UNSET || length != 2) {
add_pbf_error(s, "A two second minute could not be found", string, begin);
add_pbf_error(s, "A two digit second could not be found", string, begin);
} else {
s->time->s = sec;
}
Expand Down
2 changes: 1 addition & 1 deletion ext/date/lib/parse_date.re
Original file line number Diff line number Diff line change
Expand Up @@ -2009,7 +2009,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
TIMELIB_CHECK_NUMBER;
sec = timelib_get_nr_ex((char **) &ptr, 2, &length);
if (sec == TIMELIB_UNSET || length != 2) {
add_pbf_error(s, "A two second minute could not be found", string, begin);
add_pbf_error(s, "A two digit second could not be found", string, begin);
} else {
s->time->s = sec;
}
Expand Down
14 changes: 14 additions & 0 deletions ext/date/tests/bug64157.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Test for bug #64157: DateTime::createFromFormat() reports confusing error message
--CREDITS--
Boro Sitnikovski <buritomath@yahoo.com>
--INI--
date.timezone = UTC
--FILE--
<?php
DateTime::createFromFormat('s', '0');
$lastErrors = DateTime::getLastErrors();
print_r($lastErrors['errors'][0]);
?>
--EXPECT--
A two digit second could not be found