1--TEST-- 2Bug #36756 (DOMDocument::removeChild corrupts node) 3--SKIPIF-- 4<?php require_once('skipif.inc'); ?> 5--FILE-- 6<?php 7 8/* Node is preserved from removeChild */ 9$dom = new DOMDocument(); 10$dom->loadXML('<root><child/></root>'); 11$xpath = new DOMXpath($dom); 12$node = $xpath->query('/root')->item(0); 13echo $node->nodeName . "\n"; 14$dom->removeChild($GLOBALS['dom']->firstChild); 15echo "nodeType: " . $node->nodeType . "\n"; 16 17/* Node gets destroyed during removeChild */ 18$dom->loadXML('<root><child/></root>'); 19$xpath = new DOMXpath($dom); 20$node = $xpath->query('//child')->item(0); 21echo $node->nodeName . "\n"; 22$GLOBALS['dom']->removeChild($GLOBALS['dom']->firstChild); 23 24echo "nodeType: " . $node->nodeType . "\n"; 25 26?> 27--EXPECTF-- 28root 29nodeType: 1 30child 31 32Warning: Couldn't fetch DOMElement. Node no longer exists in %sbug36756.php on line %d 33 34Notice: Undefined property: DOMElement::$nodeType in %sbug36756.php on line %d 35nodeType: 36