xref: /php-src/ext/dom/tests/gh15192.phpt (revision 76ad89cc)
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--EXPECTF--
14object(Dom\HTMLElement)#3 (29) {
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  ["substitutedNodeValue"]=>
44  string(3) "foo"
45  ["nodeType"]=>
46  int(1)
47  ["nodeName"]=>
48  string(4) "HTML"
49  ["baseURI"]=>
50  string(11) "about:blank"
51  ["isConnected"]=>
52  bool(true)
53  ["ownerDocument"]=>
54  string(22) "(object value omitted)"
55  ["parentNode"]=>
56  string(22) "(object value omitted)"
57  ["parentElement"]=>
58  NULL
59  ["childNodes"]=>
60  string(22) "(object value omitted)"
61  ["firstChild"]=>
62  string(22) "(object value omitted)"
63  ["lastChild"]=>
64  string(22) "(object value omitted)"
65  ["previousSibling"]=>
66  NULL
67  ["nextSibling"]=>
68  NULL
69  ["nodeValue"]=>
70  NULL
71  ["textContent"]=>
72  string(3) "foo"
73}
74