Deprecate DOM_PHP_ERR (#15234)

* Deprecate DOM_PHP_ERR

RFC: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_dom_php_err_constant

* Apply suggestions from code review

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>

---------

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
This commit is contained in:
Niels Dossche 2024-08-04 22:00:01 +02:00 committed by GitHub
parent 18a99a4d33
commit 0aec0faa27
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 19 additions and 2 deletions

1
NEWS
View File

@ -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.

View File

@ -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()

View File

@ -147,6 +147,7 @@ namespace
/**
* @var int
* @deprecated is no longer used since 8.4
* @cvalue PHP_ERR
*/
const DOM_PHP_ERR = UNKNOWN;

View File

@ -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);

View File

@ -0,0 +1,11 @@
--TEST--
Test deprecation emitted on accessing DOM_PHP_ERR
--EXTENSIONS--
dom
--FILE--
<?php
var_dump(DOM_PHP_ERR);
?>
--EXPECTF--
Deprecated: Constant DOM_PHP_ERR is deprecated in %s on line %d
int(0)