xref: /php-src/ext/simplexml/tests/gh17040.phpt (revision 7acc3ac8)
1--TEST--
2GH-17040 (SimpleXML's unset can break DOM objects)
3--EXTENSIONS--
4dom
5simplexml
6--FILE--
7<?php
8$dom = new DOMDocument;
9$tag = $dom->appendChild($dom->createElement("style"));
10$html = simplexml_import_dom($tag);
11unset($html[0]);
12$tag->append("foo");
13echo $dom->saveXML(), "\n";
14echo $dom->saveXML($tag), "\n";
15var_dump($html);
16?>
17--EXPECT--
18<?xml version="1.0"?>
19
20<style>foo</style>
21object(SimpleXMLElement)#3 (1) {
22  [0]=>
23  string(3) "foo"
24}
25