diff options
Diffstat (limited to 'ext/date/php_date.c')
| -rw-r--r-- | ext/date/php_date.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index dcc71a402b..fb98fab893 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1944,6 +1944,10 @@ static void date_period_it_rewind(zend_object_iterator *iter) if (iterator->object->current) { timelib_time_dtor(iterator->object->current); } + if (!iterator->object->start) { + zend_throw_error(NULL, "DatePeriod has not been initialized correctly"); + return; + } iterator->object->current = timelib_time_clone(iterator->object->start); date_period_it_invalidate_current(iter); } |
