* PHP-5.6:
Fix DatePeriod::getEndDate() segfault
return;
}
- dpobj = (php_period_obj *)zend_object_store_get_object(getThis() TSRMLS_CC);
+ dpobj = Z_PHPPERIOD_P(getThis());
- php_date_instantiate(dpobj->start_ce, return_value TSRMLS_CC);
- dateobj = (php_date_obj *)zend_object_store_get_object(return_value TSRMLS_CC);
+ if (!dpobj->end) {
+ return;
+ }
+
+ php_date_instantiate(dpobj->start_ce, return_value);
+ dateobj = Z_PHPDATE_P(return_value);
dateobj->time = timelib_time_ctor();
*dateobj->time = *dpobj->end;
if (dpobj->end->tz_abbr) {