1--TEST--
2Delayed freeing attribute declaration
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$doc = new DOMDocument;
8$doc->loadXML(<<<'XML'
9<?xml version="1.0"?>
10<!DOCTYPE book [
11<!ELEMENT book (#PCDATA)>
12<!ATTLIST book
13title CDATA #REQUIRED
14>
15]>
16<book title="book title"/>
17XML);
18echo $doc->saveXML(), "\n";
19// Note: no way to query the attribute declaration, but this at least tests destruction order
20$doc->removeChild($doc->doctype);
21echo $doc->saveXML(), "\n";
22?>
23--EXPECT--
24<?xml version="1.0"?>
25<!DOCTYPE book [
26<!ELEMENT book (#PCDATA)>
27<!ATTLIST book title CDATA #REQUIRED>
28]>
29<book title="book title"/>
30
31<?xml version="1.0"?>
32<book title="book title"/>
33