dpobj = (php_period_obj *)zend_object_store_get_object(getThis() TSRMLS_CC);
+ if (!dpobj->end) {
+ return;
+ }
+
php_date_instantiate(dpobj->start_ce, return_value TSRMLS_CC);
dateobj = (php_date_obj *)zend_object_store_get_object(return_value TSRMLS_CC);
dateobj->time = timelib_time_ctor();
--- /dev/null
+--TEST--
+Bug #71635 (segfault in DatePeriod::getEndDate() when no end date has been set)
+--FILE--
+<?php
+date_default_timezone_set('UTC');
+$period = new DatePeriod(new DateTimeImmutable("now"), new DateInterval("P2Y4DT6H8M"), 2);
+
+var_dump($period->getEndDate());
+?>
+--EXPECT--
+NULL
\ No newline at end of file