Skip to content

Commit

Permalink
Merge branch 'PHP-8.0' into PHP-8.1
Browse files Browse the repository at this point in the history
* PHP-8.0:
  Correct IntlDateFormatter::formatObject params
  • Loading branch information
cmb69 committed Aug 15, 2022
2 parents 7f64a8d + 05ed47e commit 306da80
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ PHP NEWS
. Fixed bug GH-9309 (Segfault when connection is used after imap_close()).
(cmb)

- Intl:
. Fixed IntlDateFormatter::formatObject() parameter type. (Gert de Pagter)

- MBString:
. Fixed bug GH-9008 (mb_detect_encoding(): wrong results with null $encodings).
(cmb)
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/dateformat/dateformat.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function isLenient(): bool {}
public function format($datetime): string|false {}

/**
* @param IntlCalendar|DateTime $datetime
* @param IntlCalendar|DateTimeInterface $datetime
* @param array|int|string|null $format
* @tentative-return-type
* @alias datefmt_format_object
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/dateformat/dateformat_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 82f90e7b0528b2b3515c086763dba4de0f92dfa7 */
* Stub hash: 57ca7800d524c47a2f4e5203d4b439adfbdecb35 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 1)
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/dateformat/dateformat_format_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
}
} else {
intl_error_set(NULL, status, "datefmt_format_object: the passed object "
"must be an instance of either IntlCalendar or DateTime",
"must be an instance of either IntlCalendar or DateTimeInterface",
0);
RETURN_FALSE;
}
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/tests/dateformat_formatObject_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var_dump(IntlDateFormatter::formatObject($cal, ""));

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

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

0 comments on commit 306da80

Please sign in to comment.