Fix argument type of simplexml_import_dom (#13170)

It needs to be "object".
This is because first- and third-party extension can register custom
node types using `php_libxml_register_export`. So we don't know upfront
what types can be expected.

This also changes the error to a TypeError everywhere.
This commit is contained in:
Niels Dossche 2024-01-18 20:28:01 +01:00 committed by GitHub
parent 8cc472d5d0
commit 4bd63568fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 12 additions and 7 deletions

View file

@ -2567,7 +2567,7 @@ PHP_FUNCTION(simplexml_import_dom)
nodep = php_libxml_import_node(node);
if (!nodep) {
zend_argument_type_error(1, "must be of type SimpleXMLElement|DOMNode, %s given", zend_zval_value_name(node));
zend_argument_type_error(1, "must be a valid XML node");
RETURN_THROWS();
}