You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "s|l", &isostr, &isostr_len, &options) ==FAILURE) {
4124
-
php_error_docref(NULL, E_WARNING, "This constructor accepts either (DateTimeInterface, DateInterval, int) OR (DateTimeInterface, DateInterval, DateTime) OR (string) as arguments.");
4125
-
zend_restore_error_handling(&error_handling);
4126
-
return;
4124
+
zend_type_error("DatePeriod::__construct() accepts (DateTimeInterface, DateInterval, int [, int]), or (DateTimeInterface, DateInterval, DateTime [, int]), or (string [, int]) as arguments");
Copy file name to clipboardExpand all lines: ext/date/tests/DatePeriod_wrong_constructor.phpt
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,12 @@ Havard Eide <nucleuz@gmail.com>
7
7
date.timezone=UTC
8
8
--FILE--
9
9
<?php
10
-
newDatePeriod();
10
+
11
+
try {
12
+
newDatePeriod();
13
+
} catch (TypeError$exception) {
14
+
echo$exception->getMessage() . "\n";
15
+
}
11
16
?>
12
-
--EXPECTF--
13
-
Fatal error: Uncaught Exception: DatePeriod::__construct(): This constructor accepts either (DateTimeInterface, DateInterval, int) OR (DateTimeInterface, DateInterval, DateTime) OR (string) as arguments. in %s:%d
14
-
Stack trace:
15
-
#0 %s(%d): DatePeriod->__construct()
16
-
#1 {main}
17
-
thrown in %s on line %d
17
+
--EXPECT--
18
+
DatePeriod::__construct() accepts (DateTimeInterface, DateInterval, int [, int]), or (DateTimeInterface, DateInterval, DateTime [, int]), or (string [, int]) as arguments
0 commit comments