Skip to content

Commit 306da80

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Correct IntlDateFormatter::formatObject params
2 parents 7f64a8d + 05ed47e commit 306da80

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ PHP NEWS
2626
. Fixed bug GH-9309 (Segfault when connection is used after imap_close()).
2727
(cmb)
2828

29+
- Intl:
30+
. Fixed IntlDateFormatter::formatObject() parameter type. (Gert de Pagter)
31+
2932
- MBString:
3033
. Fixed bug GH-9008 (mb_detect_encoding(): wrong results with null $encodings).
3134
(cmb)

ext/intl/dateformat/dateformat.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function isLenient(): bool {}
118118
public function format($datetime): string|false {}
119119

120120
/**
121-
* @param IntlCalendar|DateTime $datetime
121+
* @param IntlCalendar|DateTimeInterface $datetime
122122
* @param array|int|string|null $format
123123
* @tentative-return-type
124124
* @alias datefmt_format_object

ext/intl/dateformat/dateformat_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 82f90e7b0528b2b3515c086763dba4de0f92dfa7 */
2+
* Stub hash: 57ca7800d524c47a2f4e5203d4b439adfbdecb35 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter___construct, 0, 0, 1)
55
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 1)

ext/intl/dateformat/dateformat_format_object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
190190
}
191191
} else {
192192
intl_error_set(NULL, status, "datefmt_format_object: the passed object "
193-
"must be an instance of either IntlCalendar or DateTime",
193+
"must be an instance of either IntlCalendar or DateTimeInterface",
194194
0);
195195
RETURN_FALSE;
196196
}

ext/intl/tests/dateformat_formatObject_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var_dump(IntlDateFormatter::formatObject($cal, ""));
2929

3030
?>
3131
--EXPECTF--
32-
Warning: IntlDateFormatter::formatObject(): datefmt_format_object: the passed object must be an instance of either IntlCalendar or DateTime in %s on line %d
32+
Warning: IntlDateFormatter::formatObject(): datefmt_format_object: the passed object must be an instance of either IntlCalendar or DateTimeInterface in %s on line %d
3333
bool(false)
3434

3535
Warning: IntlDateFormatter::formatObject(): datefmt_format_object: bad IntlCalendar instance: not initialized properly in %s on line %d

0 commit comments

Comments
 (0)