Merge branch 'issue11854-datetime-regression' into PHP-8.2

This commit is contained in:
Derick Rethans 2023-08-03 09:53:10 +01:00 committed by Sergey Panteleev
parent 2f540d3623
commit 1f1bce8773
No known key found for this signature in database
GPG key ID: 659A97C9CF2A795A
5 changed files with 132 additions and 109 deletions

2
NEWS
View file

@ -25,6 +25,8 @@ PHP NEWS
. Fixed bug GH-11368 (Date modify returns invalid datetime). (Derick)
. Fixed bug GH-11600 (Can't parse time strings which include (narrow)
non-breaking space characters). (Derick)
. Fixed bug GH-11854 (DateTime:createFromFormat stopped parsing datetime with
extra space). (nielsdos, Derick)
- DOM:
. Fixed bug GH-11625 (DOMElement::replaceWith() doesn't replace node with

View file

@ -1,4 +1,4 @@
/* Generated by re2c 1.0.3 on Tue Jul 11 16:19:21 2023 */
/* Generated by re2c 1.0.3 on Thu Aug 3 09:42:12 2023 */
#line 1 "ext/date/lib/parse_date.re"
/*
* The MIT License (MIT)
@ -676,7 +676,8 @@ static void timelib_eat_spaces(const char **ptr)
*ptr += 2;
continue;
}
} while (false);
break;
} while (true);
}
static void timelib_eat_until_separator(const char **ptr)
@ -1002,11 +1003,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
std:
s->tok = cursor;
s->len = 0;
#line 1135 "ext/date/lib/parse_date.re"
#line 1136 "ext/date/lib/parse_date.re"
#line 1010 "<stdout>"
#line 1011 "<stdout>"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@ -1187,23 +1188,23 @@ yy2:
YYDEBUG(2, *YYCURSOR);
++YYCURSOR;
YYDEBUG(3, *YYCURSOR);
#line 1968 "ext/date/lib/parse_date.re"
#line 1969 "ext/date/lib/parse_date.re"
{
s->pos = cursor; s->line++;
goto std;
}
#line 1196 "<stdout>"
#line 1197 "<stdout>"
yy4:
YYDEBUG(4, *YYCURSOR);
++YYCURSOR;
yy5:
YYDEBUG(5, *YYCURSOR);
#line 1974 "ext/date/lib/parse_date.re"
#line 1975 "ext/date/lib/parse_date.re"
{
add_error(s, TIMELIB_ERR_UNEXPECTED_CHARACTER, "Unexpected character");
goto std;
}
#line 1207 "<stdout>"
#line 1208 "<stdout>"
yy6:
YYDEBUG(6, *YYCURSOR);
yyaccept = 0;
@ -1218,11 +1219,11 @@ yy6:
if (yych <= '9') goto yy58;
yy8:
YYDEBUG(8, *YYCURSOR);
#line 1963 "ext/date/lib/parse_date.re"
#line 1964 "ext/date/lib/parse_date.re"
{
goto std;
}
#line 1226 "<stdout>"
#line 1227 "<stdout>"
yy9:
YYDEBUG(9, *YYCURSOR);
yych = *++YYCURSOR;
@ -1256,11 +1257,11 @@ yy11:
YYDEBUG(11, *YYCURSOR);
++YYCURSOR;
YYDEBUG(12, *YYCURSOR);
#line 1958 "ext/date/lib/parse_date.re"
#line 1959 "ext/date/lib/parse_date.re"
{
goto std;
}
#line 1264 "<stdout>"
#line 1265 "<stdout>"
yy13:
YYDEBUG(13, *YYCURSOR);
yyaccept = 1;
@ -1761,7 +1762,7 @@ yy19:
}
yy20:
YYDEBUG(20, *YYCURSOR);
#line 1873 "ext/date/lib/parse_date.re"
#line 1874 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("tzcorrection | tz");
@ -1775,7 +1776,7 @@ yy20:
TIMELIB_DEINIT;
return TIMELIB_TIMEZONE;
}
#line 1779 "<stdout>"
#line 1780 "<stdout>"
yy21:
YYDEBUG(21, *YYCURSOR);
yych = *++YYCURSOR;
@ -3580,7 +3581,7 @@ yy80:
}
yy81:
YYDEBUG(81, *YYCURSOR);
#line 1620 "ext/date/lib/parse_date.re"
#line 1621 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenoyearrev");
TIMELIB_INIT;
@ -3591,7 +3592,7 @@ yy81:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 3595 "<stdout>"
#line 3596 "<stdout>"
yy82:
YYDEBUG(82, *YYCURSOR);
yych = *++YYCURSOR;
@ -4106,7 +4107,7 @@ yy112:
}
if (yych == '.') goto yy289;
YYDEBUG(114, *YYCURSOR);
#line 1195 "ext/date/lib/parse_date.re"
#line 1196 "ext/date/lib/parse_date.re"
{
timelib_ull i;
@ -4131,7 +4132,7 @@ yy112:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 4135 "<stdout>"
#line 4136 "<stdout>"
yy115:
YYDEBUG(115, *YYCURSOR);
++YYCURSOR;
@ -5857,7 +5858,7 @@ yy176:
}
yy177:
YYDEBUG(177, *YYCURSOR);
#line 1361 "ext/date/lib/parse_date.re"
#line 1362 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("timetiny24 | timeshort24 | timelong24 | iso8601long");
@ -5884,7 +5885,7 @@ yy177:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 5888 "<stdout>"
#line 5889 "<stdout>"
yy178:
YYDEBUG(178, *YYCURSOR);
yyaccept = 4;
@ -6913,7 +6914,7 @@ yy223:
}
yy224:
YYDEBUG(224, *YYCURSOR);
#line 1455 "ext/date/lib/parse_date.re"
#line 1456 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("americanshort | american");
@ -6928,7 +6929,7 @@ yy224:
TIMELIB_DEINIT;
return TIMELIB_AMERICAN;
}
#line 6932 "<stdout>"
#line 6933 "<stdout>"
yy225:
YYDEBUG(225, *YYCURSOR);
yyaccept = 5;
@ -7171,7 +7172,7 @@ yy250:
if (yych <= '9') goto yy431;
yy251:
YYDEBUG(251, *YYCURSOR);
#line 1537 "ext/date/lib/parse_date.re"
#line 1538 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datefull");
@ -7185,7 +7186,7 @@ yy251:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL;
}
#line 7189 "<stdout>"
#line 7190 "<stdout>"
yy252:
YYDEBUG(252, *YYCURSOR);
yyaccept = 3;
@ -7299,7 +7300,7 @@ yy259:
if (yych == 'e') goto yy440;
yy260:
YYDEBUG(260, *YYCURSOR);
#line 1942 "ext/date/lib/parse_date.re"
#line 1943 "ext/date/lib/parse_date.re"
{
timelib_ull i;
DEBUG_OUTPUT("relative");
@ -7314,7 +7315,7 @@ yy260:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 7318 "<stdout>"
#line 7319 "<stdout>"
yy261:
YYDEBUG(261, *YYCURSOR);
yych = *++YYCURSOR;
@ -7760,7 +7761,7 @@ yy289:
if (yych <= '9') goto yy471;
yy290:
YYDEBUG(290, *YYCURSOR);
#line 1221 "ext/date/lib/parse_date.re"
#line 1222 "ext/date/lib/parse_date.re"
{
timelib_sll i;
timelib_ull us;
@ -7799,7 +7800,7 @@ yy290:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 7803 "<stdout>"
#line 7804 "<stdout>"
yy291:
YYDEBUG(291, *YYCURSOR);
yych = *++YYCURSOR;
@ -7824,7 +7825,7 @@ yy292:
}
yy293:
YYDEBUG(293, *YYCURSOR);
#line 1783 "ext/date/lib/parse_date.re"
#line 1784 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("ago");
TIMELIB_INIT;
@ -7844,7 +7845,7 @@ yy293:
TIMELIB_DEINIT;
return TIMELIB_AGO;
}
#line 7848 "<stdout>"
#line 7849 "<stdout>"
yy294:
YYDEBUG(294, *YYCURSOR);
yyaccept = 7;
@ -7883,7 +7884,7 @@ yy294:
}
yy295:
YYDEBUG(295, *YYCURSOR);
#line 1863 "ext/date/lib/parse_date.re"
#line 1864 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("monthtext");
TIMELIB_INIT;
@ -7892,7 +7893,7 @@ yy295:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 7896 "<stdout>"
#line 7897 "<stdout>"
yy296:
YYDEBUG(296, *YYCURSOR);
yyaccept = 7;
@ -8467,7 +8468,7 @@ yy314:
}
yy315:
YYDEBUG(315, *YYCURSOR);
#line 1804 "ext/date/lib/parse_date.re"
#line 1805 "ext/date/lib/parse_date.re"
{
const timelib_relunit* relunit;
DEBUG_OUTPUT("daytext");
@ -8484,7 +8485,7 @@ yy315:
TIMELIB_DEINIT;
return TIMELIB_WEEKDAY;
}
#line 8488 "<stdout>"
#line 8489 "<stdout>"
yy316:
YYDEBUG(316, *YYCURSOR);
yych = *++YYCURSOR;
@ -8752,7 +8753,7 @@ yy324:
}
yy325:
YYDEBUG(325, *YYCURSOR);
#line 1606 "ext/date/lib/parse_date.re"
#line 1607 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datetextual | datenoyear");
@ -8765,7 +8766,7 @@ yy325:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 8769 "<stdout>"
#line 8770 "<stdout>"
yy326:
YYDEBUG(326, *YYCURSOR);
yyaccept = 10;
@ -9459,7 +9460,7 @@ yy350:
}
yy351:
YYDEBUG(351, *YYCURSOR);
#line 1152 "ext/date/lib/parse_date.re"
#line 1153 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("now");
TIMELIB_INIT;
@ -9467,7 +9468,7 @@ yy351:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 9471 "<stdout>"
#line 9472 "<stdout>"
yy352:
YYDEBUG(352, *YYCURSOR);
yyaccept = 2;
@ -10970,7 +10971,7 @@ yy419:
}
yy420:
YYDEBUG(420, *YYCURSOR);
#line 1389 "ext/date/lib/parse_date.re"
#line 1390 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnunocolon");
TIMELIB_INIT;
@ -10992,7 +10993,7 @@ yy420:
TIMELIB_DEINIT;
return TIMELIB_GNU_NOCOLON;
}
#line 10996 "<stdout>"
#line 10997 "<stdout>"
yy421:
YYDEBUG(421, *YYCURSOR);
yyaccept = 13;
@ -11073,7 +11074,7 @@ yy421:
}
yy422:
YYDEBUG(422, *YYCURSOR);
#line 1774 "ext/date/lib/parse_date.re"
#line 1775 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("year4");
TIMELIB_INIT;
@ -11081,7 +11082,7 @@ yy422:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 11085 "<stdout>"
#line 11086 "<stdout>"
yy423:
YYDEBUG(423, *YYCURSOR);
yyaccept = 3;
@ -11688,7 +11689,7 @@ yy456:
YYDEBUG(456, *YYCURSOR);
++YYCURSOR;
YYDEBUG(457, *YYCURSOR);
#line 1323 "ext/date/lib/parse_date.re"
#line 1324 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
TIMELIB_INIT;
@ -11705,7 +11706,7 @@ yy456:
TIMELIB_DEINIT;
return TIMELIB_TIME12;
}
#line 11709 "<stdout>"
#line 11710 "<stdout>"
yy458:
YYDEBUG(458, *YYCURSOR);
yych = *++YYCURSOR;
@ -13032,7 +13033,7 @@ yy525:
}
yy526:
YYDEBUG(526, *YYCURSOR);
#line 1161 "ext/date/lib/parse_date.re"
#line 1162 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("noon");
TIMELIB_INIT;
@ -13043,7 +13044,7 @@ yy526:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 13047 "<stdout>"
#line 13048 "<stdout>"
yy527:
YYDEBUG(527, *YYCURSOR);
yyaccept = 2;
@ -14089,7 +14090,7 @@ yy566:
}
yy567:
YYDEBUG(567, *YYCURSOR);
#line 1523 "ext/date/lib/parse_date.re"
#line 1524 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshort");
@ -14102,7 +14103,7 @@ yy567:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 14106 "<stdout>"
#line 14107 "<stdout>"
yy568:
YYDEBUG(568, *YYCURSOR);
yyaccept = 15;
@ -14553,7 +14554,7 @@ yy599:
}
yy600:
YYDEBUG(600, *YYCURSOR);
#line 1592 "ext/date/lib/parse_date.re"
#line 1593 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenodayrev");
@ -14566,7 +14567,7 @@ yy600:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 14570 "<stdout>"
#line 14571 "<stdout>"
yy601:
YYDEBUG(601, *YYCURSOR);
yych = *++YYCURSOR;
@ -15941,7 +15942,7 @@ yy696:
YYDEBUG(696, *YYCURSOR);
++YYCURSOR;
YYDEBUG(697, *YYCURSOR);
#line 1578 "ext/date/lib/parse_date.re"
#line 1579 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenoday");
@ -15954,7 +15955,7 @@ yy696:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 15958 "<stdout>"
#line 15959 "<stdout>"
yy698:
YYDEBUG(698, *YYCURSOR);
yych = *++YYCURSOR;
@ -16515,7 +16516,7 @@ yy721:
}
yy722:
YYDEBUG(722, *YYCURSOR);
#line 1173 "ext/date/lib/parse_date.re"
#line 1174 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("midnight | today");
TIMELIB_INIT;
@ -16524,7 +16525,7 @@ yy722:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 16528 "<stdout>"
#line 16529 "<stdout>"
yy723:
YYDEBUG(723, *YYCURSOR);
yych = *++YYCURSOR;
@ -16834,7 +16835,7 @@ yy738:
if (yych <= '9') goto yy897;
yy739:
YYDEBUG(739, *YYCURSOR);
#line 1564 "ext/date/lib/parse_date.re"
#line 1565 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pointed date YY");
@ -16847,7 +16848,7 @@ yy739:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 16851 "<stdout>"
#line 16852 "<stdout>"
yy740:
YYDEBUG(740, *YYCURSOR);
yyaccept = 15;
@ -16959,7 +16960,7 @@ yy751:
}
yy752:
YYDEBUG(752, *YYCURSOR);
#line 1509 "ext/date/lib/parse_date.re"
#line 1510 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshorter");
@ -16972,7 +16973,7 @@ yy752:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 16976 "<stdout>"
#line 16977 "<stdout>"
yy753:
YYDEBUG(753, *YYCURSOR);
yyaccept = 18;
@ -17221,7 +17222,7 @@ yy776:
}
yy777:
YYDEBUG(777, *YYCURSOR);
#line 1435 "ext/date/lib/parse_date.re"
#line 1436 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("iso8601nocolon");
@ -17240,7 +17241,7 @@ yy777:
TIMELIB_DEINIT;
return TIMELIB_ISO_NOCOLON;
}
#line 17244 "<stdout>"
#line 17245 "<stdout>"
yy778:
YYDEBUG(778, *YYCURSOR);
yyaccept = 19;
@ -18468,7 +18469,7 @@ yy848:
}
yy849:
YYDEBUG(849, *YYCURSOR);
#line 1912 "ext/date/lib/parse_date.re"
#line 1913 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
@ -18497,7 +18498,7 @@ yy849:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 18501 "<stdout>"
#line 18502 "<stdout>"
yy850:
YYDEBUG(850, *YYCURSOR);
yyaccept = 20;
@ -19541,7 +19542,7 @@ yy925:
}
yy926:
YYDEBUG(926, *YYCURSOR);
#line 1670 "ext/date/lib/parse_date.re"
#line 1671 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgydotd");
@ -19554,7 +19555,7 @@ yy926:
TIMELIB_DEINIT;
return TIMELIB_PG_YEARDAY;
}
#line 19558 "<stdout>"
#line 19559 "<stdout>"
yy927:
YYDEBUG(927, *YYCURSOR);
yyaccept = 21;
@ -19808,7 +19809,7 @@ yy941:
if (yych <= '7') goto yy1059;
yy942:
YYDEBUG(942, *YYCURSOR);
#line 1703 "ext/date/lib/parse_date.re"
#line 1704 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweek");
@ -19826,7 +19827,7 @@ yy942:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 19830 "<stdout>"
#line 19831 "<stdout>"
yy943:
YYDEBUG(943, *YYCURSOR);
yych = *++YYCURSOR;
@ -20302,7 +20303,7 @@ yy981:
if (yych == 'e') goto yy1094;
yy982:
YYDEBUG(982, *YYCURSOR);
#line 1846 "ext/date/lib/parse_date.re"
#line 1847 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@ -20318,7 +20319,7 @@ yy982:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 20322 "<stdout>"
#line 20323 "<stdout>"
yy983:
YYDEBUG(983, *YYCURSOR);
yych = *++YYCURSOR;
@ -20665,7 +20666,7 @@ yy1020:
YYDEBUG(1020, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1021, *YYCURSOR);
#line 1552 "ext/date/lib/parse_date.re"
#line 1553 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pointed date YYYY");
TIMELIB_INIT;
@ -20676,7 +20677,7 @@ yy1020:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 20680 "<stdout>"
#line 20681 "<stdout>"
yy1022:
YYDEBUG(1022, *YYCURSOR);
++YYCURSOR;
@ -20705,7 +20706,7 @@ yy1024:
}
yy1025:
YYDEBUG(1025, *YYCURSOR);
#line 1483 "ext/date/lib/parse_date.re"
#line 1484 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("iso8601date2");
@ -20718,7 +20719,7 @@ yy1025:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 20722 "<stdout>"
#line 20723 "<stdout>"
yy1026:
YYDEBUG(1026, *YYCURSOR);
yyaccept = 15;
@ -20938,7 +20939,7 @@ yy1042:
}
yy1043:
YYDEBUG(1043, *YYCURSOR);
#line 1471 "ext/date/lib/parse_date.re"
#line 1472 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
TIMELIB_INIT;
@ -20949,7 +20950,7 @@ yy1043:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 20953 "<stdout>"
#line 20954 "<stdout>"
yy1044:
YYDEBUG(1044, *YYCURSOR);
yyaccept = 26;
@ -21064,7 +21065,7 @@ yy1047:
}
yy1048:
YYDEBUG(1048, *YYCURSOR);
#line 1632 "ext/date/lib/parse_date.re"
#line 1633 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenocolon");
TIMELIB_INIT;
@ -21075,7 +21076,7 @@ yy1048:
TIMELIB_DEINIT;
return TIMELIB_DATE_NOCOLON;
}
#line 21079 "<stdout>"
#line 21080 "<stdout>"
yy1049:
YYDEBUG(1049, *YYCURSOR);
yych = *++YYCURSOR;
@ -21145,7 +21146,7 @@ yy1059:
YYDEBUG(1059, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1060, *YYCURSOR);
#line 1684 "ext/date/lib/parse_date.re"
#line 1685 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweekday");
@ -21163,7 +21164,7 @@ yy1059:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 21167 "<stdout>"
#line 21168 "<stdout>"
yy1061:
YYDEBUG(1061, *YYCURSOR);
yych = *++YYCURSOR;
@ -21226,7 +21227,7 @@ yy1069:
if (yych <= '9') goto yy1143;
yy1070:
YYDEBUG(1070, *YYCURSOR);
#line 1722 "ext/date/lib/parse_date.re"
#line 1723 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextshort");
@ -21239,7 +21240,7 @@ yy1070:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 21243 "<stdout>"
#line 21244 "<stdout>"
yy1071:
YYDEBUG(1071, *YYCURSOR);
yych = *++YYCURSOR;
@ -21712,7 +21713,7 @@ yy1106:
++YYCURSOR;
yy1107:
YYDEBUG(1107, *YYCURSOR);
#line 1183 "ext/date/lib/parse_date.re"
#line 1184 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("tomorrow");
TIMELIB_INIT;
@ -21723,7 +21724,7 @@ yy1107:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21727 "<stdout>"
#line 21728 "<stdout>"
yy1108:
YYDEBUG(1108, *YYCURSOR);
yyaccept = 28;
@ -22060,7 +22061,7 @@ yy1140:
YYDEBUG(1140, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1141, *YYCURSOR);
#line 1736 "ext/date/lib/parse_date.re"
#line 1737 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextreverse");
@ -22073,7 +22074,7 @@ yy1140:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 22077 "<stdout>"
#line 22078 "<stdout>"
yy1142:
YYDEBUG(1142, *YYCURSOR);
++YYCURSOR;
@ -22117,7 +22118,7 @@ yy1144:
}
yy1145:
YYDEBUG(1145, *YYCURSOR);
#line 1278 "ext/date/lib/parse_date.re"
#line 1279 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("backof | frontof");
TIMELIB_INIT;
@ -22139,7 +22140,7 @@ yy1145:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 22143 "<stdout>"
#line 22144 "<stdout>"
yy1146:
YYDEBUG(1146, *YYCURSOR);
yyaccept = 29;
@ -22463,7 +22464,7 @@ yy1171:
}
yy1172:
YYDEBUG(1172, *YYCURSOR);
#line 1822 "ext/date/lib/parse_date.re"
#line 1823 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@ -22486,7 +22487,7 @@ yy1172:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 22490 "<stdout>"
#line 22491 "<stdout>"
yy1173:
YYDEBUG(1173, *YYCURSOR);
yych = *++YYCURSOR;
@ -22498,7 +22499,7 @@ yy1174:
++YYCURSOR;
yy1175:
YYDEBUG(1175, *YYCURSOR);
#line 1140 "ext/date/lib/parse_date.re"
#line 1141 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("yesterday");
TIMELIB_INIT;
@ -22509,7 +22510,7 @@ yy1175:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 22513 "<stdout>"
#line 22514 "<stdout>"
yy1176:
YYDEBUG(1176, *YYCURSOR);
yyaccept = 31;
@ -23002,7 +23003,7 @@ yy1222:
YYDEBUG(1222, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1223, *YYCURSOR);
#line 1888 "ext/date/lib/parse_date.re"
#line 1889 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
TIMELIB_INIT;
@ -23025,7 +23026,7 @@ yy1222:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 23029 "<stdout>"
#line 23030 "<stdout>"
yy1224:
YYDEBUG(1224, *YYCURSOR);
yych = *++YYCURSOR;
@ -23527,7 +23528,7 @@ yy1268:
YYDEBUG(1268, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1269, *YYCURSOR);
#line 1301 "ext/date/lib/parse_date.re"
#line 1302 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@ -23548,7 +23549,7 @@ yy1268:
TIMELIB_DEINIT;
return TIMELIB_WEEK_DAY_OF_MONTH;
}
#line 23552 "<stdout>"
#line 23553 "<stdout>"
yy1270:
YYDEBUG(1270, *YYCURSOR);
yyaccept = 24;
@ -23595,7 +23596,7 @@ yy1273:
YYDEBUG(1273, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1274, *YYCURSOR);
#line 1261 "ext/date/lib/parse_date.re"
#line 1262 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("firstdayof | lastdayof");
TIMELIB_INIT;
@ -23611,12 +23612,12 @@ yy1273:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 23615 "<stdout>"
#line 23616 "<stdout>"
yy1275:
YYDEBUG(1275, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1276, *YYCURSOR);
#line 1497 "ext/date/lib/parse_date.re"
#line 1498 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("iso8601datex");
TIMELIB_INIT;
@ -23627,7 +23628,7 @@ yy1275:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 23631 "<stdout>"
#line 23632 "<stdout>"
yy1277:
YYDEBUG(1277, *YYCURSOR);
yych = *++YYCURSOR;
@ -23730,7 +23731,7 @@ yy1290:
YYDEBUG(1290, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1291, *YYCURSOR);
#line 1341 "ext/date/lib/parse_date.re"
#line 1342 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("mssqltime");
TIMELIB_INIT;
@ -23749,7 +23750,7 @@ yy1290:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 23753 "<stdout>"
#line 23754 "<stdout>"
yy1292:
YYDEBUG(1292, *YYCURSOR);
yych = *++YYCURSOR;
@ -24173,7 +24174,7 @@ yy1328:
if (yych <= '9') goto yy1331;
yy1329:
YYDEBUG(1329, *YYCURSOR);
#line 1644 "ext/date/lib/parse_date.re"
#line 1645 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
@ -24198,7 +24199,7 @@ yy1329:
TIMELIB_DEINIT;
return TIMELIB_XMLRPC_SOAP;
}
#line 24202 "<stdout>"
#line 24203 "<stdout>"
yy1330:
YYDEBUG(1330, *YYCURSOR);
yych = *++YYCURSOR;
@ -24568,7 +24569,7 @@ yy1374:
if (yych <= ':') goto yy1383;
yy1375:
YYDEBUG(1375, *YYCURSOR);
#line 1750 "ext/date/lib/parse_date.re"
#line 1751 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("clf");
@ -24591,7 +24592,7 @@ yy1375:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 24595 "<stdout>"
#line 24596 "<stdout>"
yy1376:
YYDEBUG(1376, *YYCURSOR);
yyaccept = 33;
@ -24823,7 +24824,7 @@ yy1406:
if (yych == ':') goto yy1286;
goto yy1329;
}
#line 1978 "ext/date/lib/parse_date.re"
#line 1979 "ext/date/lib/parse_date.re"
}

View file

@ -674,7 +674,8 @@ static void timelib_eat_spaces(const char **ptr)
*ptr += 2;
continue;
}
} while (false);
break;
} while (true);
}
static void timelib_eat_until_separator(const char **ptr)

View file

@ -30,9 +30,9 @@
# include "timelib_config.h"
#endif
#define TIMELIB_VERSION 202208
#define TIMELIB_EXTENDED_VERSION 20220801
#define TIMELIB_ASCII_VERSION "2022.08"
#define TIMELIB_VERSION 202209
#define TIMELIB_EXTENDED_VERSION 20220901
#define TIMELIB_ASCII_VERSION "2022.09"
#include <stdlib.h>
#include <stdbool.h>

View file

@ -0,0 +1,19 @@
--TEST--
Bug GH-11854 (DateTime:createFromFormat stopped parsing DateTime with extra space)
--INI--
date.timezone=UTC
--FILE--
<?php
$dateTime = DateTime::createFromFormat("D M d H:i:s Y", "Wed Aug 2 08:37:50 2023");
var_dump($dateTime);
?>
--EXPECTF--
object(DateTime)#1 (3) {
["date"]=>
string(26) "2023-08-02 08:37:50.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}