Commit 52eb174ba66 for php.net

commit 52eb174ba66f62d7d65e50e18ada025967563276
Merge: 13f0fd93926 b8fc6bd1c8e
Author: Niels Dossche <7771979+ndossche@users.noreply.github.com>
Date:   Tue Feb 3 18:40:54 2026 +0100

    Merge branch 'PHP-8.4' into PHP-8.5

    * PHP-8.4:
      Fix GH-21097: Accessing Dom\Node properties can can throw TypeError(s)

diff --cc NEWS
index 5859db5dc81,6416ddedb98..a6314fec093
--- a/NEWS
+++ b/NEWS
@@@ -17,7 -12,17 +17,9 @@@ PH
  - DOM:
    . Fixed bug GH-21077 (Accessing Dom\Node::baseURI can throw TypeError).
      (ndossche)
+   . Fixed bug GH-21097 (Accessing Dom\Node properties can can throw TypeError).
+     (ndossche)

 -- PDO_PGSQL:
 -  . Fixed bug GH-21055 (connection attribute status typo for GSS negotiation).
 -    (lsaos)
 -
  - Windows:
    . Fixed compilation with clang (missing intrin.h include). (Kévin Dunglas)

diff --cc ext/dom/documenttype.c
index 63da0306649,6af23fd73c4..21233cea599
--- a/ext/dom/documenttype.c
+++ b/ext/dom/documenttype.c
@@@ -49,7 -47,7 +49,7 @@@ zend_result dom_documenttype_entities_r
  {
  	DOM_PROP_NODE(xmlDtdPtr, dtdptr, obj);

- 	object_init_ex(retval, dom_get_dtd_namednodemap_ce(php_dom_follow_spec_intern(obj)));
 -	php_dom_create_iterator(retval, DOM_DTD_NAMEDNODEMAP, instanceof_function(obj->std.ce, dom_modern_documenttype_class_entry));
++	object_init_ex(retval, dom_get_dtd_namednodemap_ce(instanceof_function(obj->std.ce, dom_modern_documenttype_class_entry)));

  	xmlHashTable *entityht = (xmlHashTable *) dtdptr->entities;

@@@ -70,7 -68,7 +70,7 @@@ zend_result dom_documenttype_notations_
  {
  	DOM_PROP_NODE(xmlDtdPtr, dtdptr, obj);

- 	object_init_ex(retval, dom_get_dtd_namednodemap_ce(php_dom_follow_spec_intern(obj)));
 -	php_dom_create_iterator(retval, DOM_DTD_NAMEDNODEMAP, instanceof_function(obj->std.ce, dom_modern_documenttype_class_entry));
++	object_init_ex(retval, dom_get_dtd_namednodemap_ce(instanceof_function(obj->std.ce, dom_modern_documenttype_class_entry)));

  	xmlHashTable *notationht = (xmlHashTable *) dtdptr->notations;

diff --cc ext/dom/node.c
index 12f04761a1e,9c1a508d669..7fcf9d1dbe4
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@@ -287,9 -287,20 +287,20 @@@ zend_result dom_node_child_nodes_read(d
  {
  	DOM_PROP_NODE(xmlNodePtr, nodep, obj);

- 	object_init_ex(retval, dom_get_nodelist_ce(php_dom_follow_spec_intern(obj)));
 -	php_dom_create_iterator(retval, DOM_NODELIST, false);
++	object_init_ex(retval, dom_get_nodelist_ce(false));
+ 	dom_object *intern = Z_DOMOBJ_P(retval);
 -	dom_namednode_iter(obj, XML_ELEMENT_NODE, intern, NULL, NULL, 0, NULL, 0);
++	php_dom_create_obj_map(obj, intern, NULL, NULL, NULL, &php_dom_obj_map_child_nodes);
+
+ 	return SUCCESS;
+ }
+
+ zend_result dom_modern_node_child_nodes_read(dom_object *obj, zval *retval)
+ {
+ 	DOM_PROP_NODE(xmlNodePtr, nodep, obj);
+
 -	php_dom_create_iterator(retval, DOM_NODELIST, true);
++	object_init_ex(retval, dom_get_nodelist_ce(true));
  	dom_object *intern = Z_DOMOBJ_P(retval);
 -	dom_namednode_iter(obj, XML_ELEMENT_NODE, intern, NULL, NULL, 0, NULL, 0);
 +	php_dom_create_obj_map(obj, intern, NULL, NULL, NULL, &php_dom_obj_map_child_nodes);

  	return SUCCESS;
  }