xref: /php-src/ext/dom/tests/gh15192.phpt (revision 402b1c29)
1--TEST--
2GH-15192 (Segmentation fault in dom extension (html5_serializer))
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$dom = @Dom\HTMLDocument::createFromString("<p>foo</p>");
8$dom2 = clone $dom;
9$element = $dom2->firstChild;
10$dom = new DomDocument();
11var_dump($element);
12?>
13--EXPECT--
14object(Dom\HTMLElement)#3 (30) {
15  ["namespaceURI"]=>
16  string(28) "http://www.w3.org/1999/xhtml"
17  ["prefix"]=>
18  NULL
19  ["localName"]=>
20  string(4) "html"
21  ["tagName"]=>
22  string(4) "HTML"
23  ["id"]=>
24  string(0) ""
25  ["className"]=>
26  string(0) ""
27  ["classList"]=>
28  string(22) "(object value omitted)"
29  ["attributes"]=>
30  string(22) "(object value omitted)"
31  ["firstElementChild"]=>
32  string(22) "(object value omitted)"
33  ["lastElementChild"]=>
34  string(22) "(object value omitted)"
35  ["childElementCount"]=>
36  int(2)
37  ["previousElementSibling"]=>
38  NULL
39  ["nextElementSibling"]=>
40  NULL
41  ["innerHTML"]=>
42  string(36) "<head></head><body><p>foo</p></body>"
43  ["outerHTML"]=>
44  string(49) "<html><head></head><body><p>foo</p></body></html>"
45  ["substitutedNodeValue"]=>
46  string(3) "foo"
47  ["nodeType"]=>
48  int(1)
49  ["nodeName"]=>
50  string(4) "HTML"
51  ["baseURI"]=>
52  string(11) "about:blank"
53  ["isConnected"]=>
54  bool(true)
55  ["ownerDocument"]=>
56  string(22) "(object value omitted)"
57  ["parentNode"]=>
58  string(22) "(object value omitted)"
59  ["parentElement"]=>
60  NULL
61  ["childNodes"]=>
62  string(22) "(object value omitted)"
63  ["firstChild"]=>
64  string(22) "(object value omitted)"
65  ["lastChild"]=>
66  string(22) "(object value omitted)"
67  ["previousSibling"]=>
68  NULL
69  ["nextSibling"]=>
70  NULL
71  ["nodeValue"]=>
72  NULL
73  ["textContent"]=>
74  string(3) "foo"
75}
76