From d9eb3783bdd6947a635f132f8c240de8f40e8704 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 4 Aug 2024 23:30:52 +0200 Subject: [PATCH] Remove DOMImplementation::getFeature() (#15233) RFC: https://wiki.php.net/rfc/deprecations_php_8_4#remove_domimplementationgetfeature_feature_version --- NEWS | 1 + UPGRADING | 4 ++++ ext/dom/domimplementation.c | 17 ----------------- ext/dom/php_dom.stub.php | 3 --- ext/dom/php_dom_arginfo.h | 9 +-------- 5 files changed, 6 insertions(+), 28 deletions(-) diff --git a/NEWS b/NEWS index ea0579e63c3..9b2c40872b2 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,7 @@ PHP NEWS . Fixed bug GH-15192 (Segmentation fault in dom extension (html5_serializer)). (nielsdos) . Deprecated DOM_PHP_ERR constant. (nielsdos) + . Removed DOMImplementation::getFeature(). (nielsdos) - PHPDBG: . array out of bounds, stack overflow handled for segfault handler on windows. diff --git a/UPGRADING b/UPGRADING index 76a15ff24f1..6f48afe6b76 100644 --- a/UPGRADING +++ b/UPGRADING @@ -761,6 +761,10 @@ PHP 8.4 UPGRADE NOTES - Date: . The class constants are typed now. +- DOM: + . Removed DOMImplementation::getFeature(). + RFC: https://wiki.php.net/rfc/deprecations_php_8_4#remove_domimplementationgetfeature_feature_version + - Intl: . The class constants are typed now. . The behaviour of Intl class has been normalized to always throw Error diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c index 0c2b2c61b30..7997dcfed12 100644 --- a/ext/dom/domimplementation.c +++ b/ext/dom/domimplementation.c @@ -415,21 +415,4 @@ PHP_METHOD(Dom_Implementation, createHTMLDocument) } /* }}} */ -/* {{{ URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementation3-getFeature -Since: DOM Level 3 -*/ -PHP_METHOD(DOMImplementation, getFeature) -{ - size_t feature_len, version_len; - char *feature, *version; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &feature, &feature_len, &version, &version_len) == FAILURE) { - RETURN_THROWS(); - } - - zend_throw_error(NULL, "Not yet implemented"); - RETURN_THROWS(); -} -/* }}} end dom_domimplementation_get_feature */ - #endif diff --git a/ext/dom/php_dom.stub.php b/ext/dom/php_dom.stub.php index 65cf64989d9..48d28a32696 100644 --- a/ext/dom/php_dom.stub.php +++ b/ext/dom/php_dom.stub.php @@ -454,9 +454,6 @@ namespace class DOMImplementation { - /** @tentative-return-type */ - public function getFeature(string $feature, string $version): never {} - /** @tentative-return-type */ public function hasFeature(string $feature, string $version): bool {} diff --git a/ext/dom/php_dom_arginfo.h b/ext/dom/php_dom_arginfo.h index c8167234e87..08bc3ad1f64 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: 09b3f1df4ce6b20e7d25214a522ea1e6e5faabf4 */ + * Stub hash: 085c060d5a6f3d0c3db1cdbe5c5a3ec4ca261d5c */ 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) @@ -131,11 +131,6 @@ ZEND_END_ARG_INFO() #define arginfo_class_DOMNameSpaceNode___wakeup arginfo_class_DOMChildNode_remove -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DOMImplementation_getFeature, 0, 2, IS_NEVER, 0) - ZEND_ARG_TYPE_INFO(0, feature, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, version, IS_STRING, 0) -ZEND_END_ARG_INFO() - #define arginfo_class_DOMImplementation_hasFeature arginfo_class_DOMNode_isSupported ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DOMImplementation_createDocumentType, 0, 0, 1) @@ -1200,7 +1195,6 @@ ZEND_METHOD(DOMNode, getRootNode); ZEND_METHOD(DOMNode, compareDocumentPosition); ZEND_METHOD(DOMNode, __sleep); ZEND_METHOD(DOMNode, __wakeup); -ZEND_METHOD(DOMImplementation, getFeature); ZEND_METHOD(DOMImplementation, hasFeature); ZEND_METHOD(DOMImplementation, createDocumentType); ZEND_METHOD(DOMImplementation, createDocument); @@ -1467,7 +1461,6 @@ static const zend_function_entry class_DOMNameSpaceNode_methods[] = { }; static const zend_function_entry class_DOMImplementation_methods[] = { - ZEND_ME(DOMImplementation, getFeature, arginfo_class_DOMImplementation_getFeature, ZEND_ACC_PUBLIC) ZEND_ME(DOMImplementation, hasFeature, arginfo_class_DOMImplementation_hasFeature, ZEND_ACC_PUBLIC) ZEND_ME(DOMImplementation, createDocumentType, arginfo_class_DOMImplementation_createDocumentType, ZEND_ACC_PUBLIC) ZEND_ME(DOMImplementation, createDocument, arginfo_class_DOMImplementation_createDocument, ZEND_ACC_PUBLIC)