diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index 9428ce380415a..0e99e231d6210 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -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; } diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index 7efeb430c3be1..6d91d9ada9e41 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -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; } diff --git a/ext/date/tests/bug64157.phpt b/ext/date/tests/bug64157.phpt new file mode 100644 index 0000000000000..fb71495430c72 --- /dev/null +++ b/ext/date/tests/bug64157.phpt @@ -0,0 +1,14 @@ +--TEST-- +Test for bug #64157: DateTime::createFromFormat() reports confusing error message +--CREDITS-- +Boro Sitnikovski +--INI-- +date.timezone = UTC +--FILE-- + +--EXPECT-- +A two digit second could not be found