1--TEST--
2Delayed freeing namespace xmlns declaration
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$doc = new DOMDocument;
8$doc->loadXML('<?xml version="1.0"?><container xmlns="http://php.net"/>');
9$doc->documentElement->appendChild($el = $doc->createElementNS('http://php.net', 'example'));
10echo $doc->saveXML(), "\n";
11
12$doc->documentElement->remove();
13echo $doc->saveXML(), "\n";
14
15var_dump($el->namespaceURI);
16?>
17--EXPECT--
18<?xml version="1.0"?>
19<container xmlns="http://php.net"><example/></container>
20
21<?xml version="1.0"?>
22
23string(14) "http://php.net"
24