xref: /PHP-8.1/ext/dom/tests/bug37277.phpt (revision bd9f4fa6)
1--TEST--
2Bug #37277 (cloning Dom Documents or Nodes does not work)
3--EXTENSIONS--
4dom
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<?xml version="1.0" encoding="UTF-8"?>
23<foo/>
24