Skip to content

Commit 85f3a96

Browse files
committed
Revert "Fixed #80047: DatePeriod doesn't warn with custom DateTimeImmutable"
This reverts commit 973c3f6.
1 parent 8ed21a8 commit 85f3a96

File tree

2 files changed

+0
-55
lines changed

2 files changed

+0
-55
lines changed

ext/date/php_date.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4227,20 +4227,6 @@ PHP_METHOD(DatePeriod, __construct)
42274227
}
42284228
dpobj->start_ce = date_ce_date;
42294229
} else {
4230-
/* Sanity checks */
4231-
if (start && Z_OBJCE_P(start) != date_ce_date && Z_OBJCE_P(start) != date_ce_immutable) {
4232-
zend_string *func = get_active_function_or_method_name();
4233-
zend_throw_error(zend_ce_exception, "%s(): Class of start date must be exactly DateTime or DateTimeImmutable, object of class %s provided", ZSTR_VAL(func), ZSTR_VAL(Z_OBJCE_P(start)->name));
4234-
zend_string_release(func);
4235-
RETURN_THROWS();
4236-
}
4237-
if (end && Z_OBJCE_P(end) != date_ce_date && Z_OBJCE_P(end) != date_ce_immutable) {
4238-
zend_string *func = get_active_function_or_method_name();
4239-
zend_throw_error(zend_ce_exception, "%s(): Class of end date must be exactly DateTime or DateTimeImmutable, object of class %s provided", ZSTR_VAL(func), ZSTR_VAL(Z_OBJCE_P(end)->name));
4240-
zend_string_release(func);
4241-
RETURN_THROWS();
4242-
}
4243-
42444230
/* init */
42454231
php_interval_obj *intobj = Z_PHPINTERVAL_P(interval);
42464232

ext/date/tests/bug80042.phpt

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)