1--TEST--
2Delayed freeing namespace definition should not crash
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$doc = new DOMDocument;
8$doc->appendChild($doc->createElement('container'));
9$child = $doc->documentElement->appendChild($doc->createElementNS('some:ns', 'child'));
10$child_child = $child->appendChild($doc->createElementNS('some:ns', 'x'));
11
12echo $doc->saveXML();
13
14$child->remove();
15echo $doc->saveXML();
16
17unset($child);
18var_dump($child_child->namespaceURI);
19?>
20--EXPECT--
21<?xml version="1.0"?>
22<container><child xmlns="some:ns"><x/></child></container>
23<?xml version="1.0"?>
24<container/>
25string(7) "some:ns"
26