Skip to content

Commit 6b38fcd

Browse files
derickrcarusogabriel
authored andcommitted
Revert "Fixed #80047: DatePeriod doesn't warn with custom DateTimeImmutable"
This reverts commit 973c3f6.
1 parent f3738d6 commit 6b38fcd

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
@@ -4238,20 +4238,6 @@ PHP_METHOD(DatePeriod, __construct)
42384238
}
42394239
dpobj->start_ce = date_ce_date;
42404240
} else {
4241-
/* Sanity checks */
4242-
if (start && Z_OBJCE_P(start) != date_ce_date && Z_OBJCE_P(start) != date_ce_immutable) {
4243-
zend_string *func = get_active_function_or_method_name();
4244-
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));
4245-
zend_string_release(func);
4246-
RETURN_THROWS();
4247-
}
4248-
if (end && Z_OBJCE_P(end) != date_ce_date && Z_OBJCE_P(end) != date_ce_immutable) {
4249-
zend_string *func = get_active_function_or_method_name();
4250-
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));
4251-
zend_string_release(func);
4252-
RETURN_THROWS();
4253-
}
4254-
42554241
/* init */
42564242
php_interval_obj *intobj = Z_PHPINTERVAL_P(interval);
42574243

ext/date/tests/bug80042.phpt

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

0 commit comments

Comments
 (0)