mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Deprecate calling DatePeriod::__construct() with less than 3 arguments
This commit is contained in:
parent
866aa12bcd
commit
adc26424aa
8 changed files with 34 additions and 5 deletions
|
@ -5061,6 +5061,12 @@ PHP_METHOD(DatePeriod, __construct)
|
|||
dpobj->current = NULL;
|
||||
|
||||
if (isostr) {
|
||||
zend_error(E_DEPRECATED, "Calling DatePeriod::__construct(string $isostr, int $options = 0) is deprecated, "
|
||||
"use DatePeriod::createFromISO8601String() instead");
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
if (!date_period_init_iso8601_string(dpobj, date_ce_date, isostr, isostr_len, options, &recurrences)) {
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue