1--TEST--
2replaceChild() where the new node is a grandparent of the old node
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$document = new DOMDocument();
8$a = $document->createElement('a');
9$b = $document->createElement('b');
10$c = $document->createElement('c');
11$a->appendChild($b);
12$b->appendChild($c);
13try {
14	$b->replaceChild($a, $c);
15} catch (DOMException $e) {
16	echo "DOMException: " . $e->getMessage();
17}
18?>
19--EXPECT--
20DOMException: Hierarchy Request Error
21