diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c index 37b4f43322e3f..d87131dc6086a 100644 --- a/ext/date/lib/tm2unixtime.c +++ b/ext/date/lib/tm2unixtime.c @@ -149,9 +149,6 @@ static void do_adjust_for_weekday(timelib_time* time) current_dow = timelib_day_of_week(time->y, time->m, time->d); if (time->relative.weekday_behavior == 2) { - if (time->relative.weekday == 0) { - time->relative.weekday = 7; - } time->d -= current_dow; time->d += time->relative.weekday; return; diff --git a/ext/date/tests/bug63392.phpt b/ext/date/tests/bug63392.phpt new file mode 100644 index 0000000000000..51cb7b9ff6d90 --- /dev/null +++ b/ext/date/tests/bug63392.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #63392 (DateTime::modify() start of week inconsistency) +Description: +------------ + + +--INI-- +date.timezone=UTC +--FILE-- +modify("Sunday this week"); +var_dump($dt->format('r')); +?> +--EXPECT-- +string(31) "Sun, 13 May 2012 00:00:00 +0000"