1--TEST--
2replaceChild with attribute children
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$dom = new DOMDocument;
9$attr = $dom->createAttribute('attr');
10$attr->textContent = "test";
11
12try {
13    $attr->replaceChild($dom->createProcessingInstruction('pi'), $attr->firstChild);
14} catch (DOMException $e) {
15    echo $e->getMessage(), "\n";
16}
17
18$root = $dom->appendChild($dom->createElement('root'));
19$root->setAttributeNode($attr);
20
21echo $dom->saveXML();
22
23?>
24--EXPECT--
25Hierarchy Request Error
26<?xml version="1.0"?>
27<root attr="test"/>
28