Skip to content

Commit ab34c77

Browse files
committed
Fix return value when DateTimeImmutable::createFromFormat() for PHP 5
1 parent 7e8816a commit ab34c77

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: timecop_php5.c

+6
Original file line numberDiff line numberDiff line change
@@ -1520,6 +1520,12 @@ static void _timecop_date_create_from_format(INTERNAL_FUNCTION_PARAMETERS, int i
15201520

15211521
if (memchr(orig_format_str, '!', orig_format_len) ||
15221522
memchr(orig_format_str, '|', orig_format_len)) {
1523+
1524+
if (immutable) {
1525+
call_php_function_with_3_params(ORIG_FUNC_NAME("date_create_immutable_from_format"), &new_dt, &orig_format, &orig_time, orig_timezone);
1526+
RETURN_ZVAL(new_dt, 1, 1);
1527+
}
1528+
15231529
RETURN_ZVAL(dt, 1, 1);
15241530
}
15251531

0 commit comments

Comments
 (0)