1--TEST--
2Lifetime issue with parentNode on getAttributeNodeNS()
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$xmlString = '<?xml version="1.0" encoding="utf-8" ?>
8<root xmlns="http://ns" xmlns:ns2="http://ns2">
9    <ns2:child />
10</root>';
11
12$xml=new DOMDocument();
13$xml->loadXML($xmlString);
14$ns2 = $xml->documentElement->getAttributeNodeNS("http://www.w3.org/2000/xmlns/", "ns2");
15$ns2->parentNode->remove();
16var_dump($ns2->parentNode->localName);
17
18?>
19--EXPECT--
20string(4) "root"
21