diff --git a/NEWS b/NEWS index 5d237a6460c62..7980ff66c4480 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,10 @@ PHP NEWS . Updated build system scripts config.guess to 2024-07-27 and config.sub to 2024-05-27. (Peter Kokot) +- Date: + . Constants SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, and SUNFUNCS_RET_DOUBLE + are now deprecated. (Jorg Sowa) + - DOM: . Fixed bug GH-15192 (Segmentation fault in dom extension (html5_serializer)). (nielsdos) diff --git a/UPGRADING b/UPGRADING index e41faf5dd40ed..96bb46e139473 100644 --- a/UPGRADING +++ b/UPGRADING @@ -404,6 +404,10 @@ PHP 8.4 UPGRADE NOTES - Date: . Calling DatePeriod::__construct(string $isostr, int $options = 0) is deprecated. Use DatePeriod::createFromISO8601String() instead. + . Constants SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, and + SUNFUNCS_RET_DOUBLE are now deprecated, following the deprecation of + the associated date_sunset() and date_sunrise() functions in PHP 8.1. + RFC: https://wiki.php.net/rfc/deprecations_php_8_4 - Intl: . Calling intlcal_set() as well as calling IntlCalendar::set() with diff --git a/ext/date/php_date.stub.php b/ext/date/php_date.stub.php index a33e52061f589..e18221e712a5d 100644 --- a/ext/date/php_date.stub.php +++ b/ext/date/php_date.stub.php @@ -83,18 +83,21 @@ /** * @var int * @cvalue SUNFUNCS_RET_TIMESTAMP + * @deprecated */ const SUNFUNCS_RET_TIMESTAMP = UNKNOWN; /** * @var int * @cvalue SUNFUNCS_RET_STRING + * @deprecated */ const SUNFUNCS_RET_STRING = UNKNOWN; /** * @var int * @cvalue SUNFUNCS_RET_DOUBLE + * @deprecated */ const SUNFUNCS_RET_DOUBLE = UNKNOWN; diff --git a/ext/date/php_date_arginfo.h b/ext/date/php_date_arginfo.h index bf026f75ce22d..9f7fd234dc647 100644 --- a/ext/date/php_date_arginfo.h +++ b/ext/date/php_date_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: ec4cc71df0beb55d07dcc77d0bc47e1b67b48911 */ + * Stub hash: 41c7662745d19808dd4550b37cd1b9f2aa94d75b */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_strtotime, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, datetime, IS_STRING, 0) @@ -844,9 +844,9 @@ static void register_php_date_symbols(int module_number) ZEND_ASSERT(strcmp(DATE_FORMAT_RFC3339_EXTENDED, "Y-m-d\\TH:i:s.vP") == 0); REGISTER_STRING_CONSTANT("DATE_RSS", DATE_FORMAT_RFC1123, CONST_PERSISTENT); REGISTER_STRING_CONSTANT("DATE_W3C", DATE_FORMAT_RFC3339, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SUNFUNCS_RET_TIMESTAMP", SUNFUNCS_RET_TIMESTAMP, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SUNFUNCS_RET_STRING", SUNFUNCS_RET_STRING, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SUNFUNCS_RET_DOUBLE", SUNFUNCS_RET_DOUBLE, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SUNFUNCS_RET_TIMESTAMP", SUNFUNCS_RET_TIMESTAMP, CONST_PERSISTENT | CONST_DEPRECATED); + REGISTER_LONG_CONSTANT("SUNFUNCS_RET_STRING", SUNFUNCS_RET_STRING, CONST_PERSISTENT | CONST_DEPRECATED); + REGISTER_LONG_CONSTANT("SUNFUNCS_RET_DOUBLE", SUNFUNCS_RET_DOUBLE, CONST_PERSISTENT | CONST_DEPRECATED); zend_attribute *attribute_Deprecated_func_strftime_0 = zend_add_function_attribute(zend_hash_str_find_ptr(CG(function_table), "strftime", sizeof("strftime") - 1), ZSTR_KNOWN(ZEND_STR_DEPRECATED), 2); diff --git a/ext/date/tests/date_sunrise_and_sunset_basic.phpt b/ext/date/tests/date_sunrise_and_sunset_basic.phpt index c986e33088284..e5f5efa73e177 100644 --- a/ext/date/tests/date_sunrise_and_sunset_basic.phpt +++ b/ext/date/tests/date_sunrise_and_sunset_basic.phpt @@ -25,9 +25,13 @@ var_dump(gettype(date_sunset(time()))); --EXPECTF-- Basic test for date_sunrise() and date_sunset() +Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in %s on line %d + Deprecated: Function date_sunrise() is deprecated since 8.1, use date_sun_info() instead in %s on line %d %s %s %d %d, sunrise time : %d:%d +Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in %s on line %d + Deprecated: Function date_sunset() is deprecated since 8.1, use date_sun_info() instead in %s on line %d %s %s %d %d, sunset time : %d:%d diff --git a/ext/reflection/tests/internal_parameter_default_value/check_all.phpt b/ext/reflection/tests/internal_parameter_default_value/check_all.phpt index 7bfe08bc56f14..534f781c4fc1a 100644 --- a/ext/reflection/tests/internal_parameter_default_value/check_all.phpt +++ b/ext/reflection/tests/internal_parameter_default_value/check_all.phpt @@ -29,5 +29,8 @@ foreach (get_declared_classes() as $class) { ?> ===DONE=== ---EXPECT-- +--EXPECTF-- +Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in %s on line %d + +Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in %s on line %d ===DONE===