xref: /PHP-8.2/ext/dom/tests/bug65196.phpt (revision bd9f4fa6)
1--TEST--
2bug #65196 (Passing DOMDocumentFragment to DOMDocument::saveHTML() Produces invalid Markup)
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$dom = new DOMDocument();
8
9$frag1 = $dom->createDocumentFragment();
10var_dump($dom->saveHTML($frag1));
11
12$frag2 = $dom->createDocumentFragment();
13$div = $dom->createElement('div');
14$div->appendChild($dom->createElement('span'));
15$frag2->appendChild($div);
16$frag2->appendChild($dom->createElement('div'));
17$frag2->appendChild($dom->createElement('div'));
18var_dump($dom->saveHTML($frag2));
19?>
20--EXPECT--
21string(0) ""
22string(46) "<div><span></span></div><div></div><div></div>"
23