1--TEST-- 2Bug #37277 (cloning Dom Documents or Nodes does not work) 3--SKIPIF-- 4<?php require_once('skipif.inc'); ?> 5--FILE-- 6<?php 7$dom1 = new DomDocument('1.0', 'UTF-8'); 8 9$xml = '<foo />'; 10$dom1->loadXml($xml); 11 12$node = clone $dom1->documentElement; 13 14$dom2 = new DomDocument('1.0', 'UTF-8'); 15$dom2->appendChild($dom2->importNode($node->cloneNode(true), TRUE)); 16 17print $dom2->saveXML(); 18 19 20?> 21--EXPECT-- 22 23<?xml version="1.0" encoding="UTF-8"?> 24<foo/> 25 26