Skip to content

Commit 05ed47e

Browse files
BackEndTeacmb69
authored andcommitted
Correct IntlDateFormatter::formatObject params
Closes GH-9341.
1 parent b8d0745 commit 05ed47e

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
@@ -10,6 +10,9 @@ PHP NEWS
1010
. Fixed bug GH-9155 (dba_open("non-existing", "c-", "flatfile") segfaults).
1111
(cmb)
1212

13+
- Intl:
14+
. Fixed IntlDateFormatter::formatObject() parameter type. (Gert de Pagter)
15+
1316
- OPcache:
1417
. Fixed bug GH-9033 (Loading blacklist file can fail due to negative length).
1518
(cmb)

ext/intl/dateformat/dateformat.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function isLenient() {}
104104
public function format($datetime) {}
105105

106106
/**
107-
* @param IntlCalendar|DateTime $datetime
107+
* @param IntlCalendar|DateTimeInterface $datetime
108108
* @param array|int|string|null $format
109109
* @return string|false
110110
* @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: faeef90c9c1324c6a25f0df36c7239ddc2b43ee4 */
2+
* Stub hash: 425a285b704e175ccd0313fe1be85c8abaf820b7 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter___construct, 0, 0, 3)
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
@@ -31,7 +31,7 @@ var_dump(IntlDateFormatter::formatObject($cal, ""));
3131

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

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

0 commit comments

Comments
 (0)