diff --git a/NEWS b/NEWS index 7980ff66c44..ea0579e63c3 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ PHP NEWS - DOM: . Fixed bug GH-15192 (Segmentation fault in dom extension (html5_serializer)). (nielsdos) + . Deprecated DOM_PHP_ERR constant. (nielsdos) - PHPDBG: . array out of bounds, stack overflow handled for segfault handler on windows. diff --git a/UPGRADING b/UPGRADING index 96bb46e1394..76a15ff24f1 100644 --- a/UPGRADING +++ b/UPGRADING @@ -409,6 +409,10 @@ PHP 8.4 UPGRADE NOTES the associated date_sunset() and date_sunrise() functions in PHP 8.1. RFC: https://wiki.php.net/rfc/deprecations_php_8_4 +- DOM: + . Deprecated DOM_PHP_ERR constant. + RFC: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_dom_php_err_constant + - Intl: . Calling intlcal_set() as well as calling IntlCalendar::set() with more than 2 arguments is deprecated. Use either IntlCalendar::setDate() diff --git a/ext/dom/php_dom.stub.php b/ext/dom/php_dom.stub.php index f678c7376d1..65cf64989d9 100644 --- a/ext/dom/php_dom.stub.php +++ b/ext/dom/php_dom.stub.php @@ -147,6 +147,7 @@ namespace /** * @var int + * @deprecated is no longer used since 8.4 * @cvalue PHP_ERR */ const DOM_PHP_ERR = UNKNOWN; diff --git a/ext/dom/php_dom_arginfo.h b/ext/dom/php_dom_arginfo.h index 90db1e81af0..c8167234e87 100644 --- a/ext/dom/php_dom_arginfo.h +++ b/ext/dom/php_dom_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 9a1e6842b2c5b891e11087d40aa8c9f56a2269a3 */ + * Stub hash: 09b3f1df4ce6b20e7d25214a522ea1e6e5faabf4 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_dom_import_simplexml, 0, 1, DOMElement, 0) ZEND_ARG_TYPE_INFO(0, node, IS_OBJECT, 0) @@ -1973,7 +1973,7 @@ static void register_php_dom_symbols(int module_number) REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NMTOKENS", XML_ATTRIBUTE_NMTOKENS, CONST_PERSISTENT); REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_ENUMERATION", XML_ATTRIBUTE_ENUMERATION, CONST_PERSISTENT); REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NOTATION", XML_ATTRIBUTE_NOTATION, CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_PHP_ERR", PHP_ERR, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("DOM_PHP_ERR", PHP_ERR, CONST_PERSISTENT | CONST_DEPRECATED); REGISTER_LONG_CONSTANT("DOM_INDEX_SIZE_ERR", INDEX_SIZE_ERR, CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DOMSTRING_SIZE_ERR", DOMSTRING_SIZE_ERR, CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DOM_HIERARCHY_REQUEST_ERR", HIERARCHY_REQUEST_ERR, CONST_PERSISTENT); diff --git a/ext/dom/tests/DOM_PHP_ERR_deprecated.phpt b/ext/dom/tests/DOM_PHP_ERR_deprecated.phpt new file mode 100644 index 00000000000..76bd2757e7b --- /dev/null +++ b/ext/dom/tests/DOM_PHP_ERR_deprecated.phpt @@ -0,0 +1,11 @@ +--TEST-- +Test deprecation emitted on accessing DOM_PHP_ERR +--EXTENSIONS-- +dom +--FILE-- + +--EXPECTF-- +Deprecated: Constant DOM_PHP_ERR is deprecated in %s on line %d +int(0)