1--TEST-- 2Dom\XMLDocument getting ownerDocument from a node in an XML document should yield a Dom\XMLDocument 3--EXTENSIONS-- 4dom 5--FILE-- 6<?php 7 8$dom = Dom\XMLDocument::createFromString('<?xml version="1.0"?><container/>'); 9 10$element = $dom->documentElement; 11unset($dom); 12var_dump($element->ownerDocument); 13 14?> 15--EXPECTF-- 16object(Dom\XMLDocument)#1 (32) { 17 ["xmlEncoding"]=> 18 string(5) "UTF-8" 19 ["xmlStandalone"]=> 20 bool(false) 21 ["xmlVersion"]=> 22 string(3) "1.0" 23 ["formatOutput"]=> 24 bool(false) 25 ["implementation"]=> 26 string(22) "(object value omitted)" 27 ["URL"]=> 28 string(%d) "%s" 29 ["documentURI"]=> 30 string(%d) "%s" 31 ["characterSet"]=> 32 string(5) "UTF-8" 33 ["charset"]=> 34 string(5) "UTF-8" 35 ["inputEncoding"]=> 36 string(5) "UTF-8" 37 ["doctype"]=> 38 NULL 39 ["documentElement"]=> 40 string(22) "(object value omitted)" 41 ["firstElementChild"]=> 42 string(22) "(object value omitted)" 43 ["lastElementChild"]=> 44 string(22) "(object value omitted)" 45 ["childElementCount"]=> 46 int(1) 47 ["body"]=> 48 NULL 49 ["head"]=> 50 NULL 51 ["title"]=> 52 string(0) "" 53 ["nodeType"]=> 54 int(9) 55 ["nodeName"]=> 56 string(9) "#document" 57 ["baseURI"]=> 58 string(%d) "%s" 59 ["isConnected"]=> 60 bool(true) 61 ["ownerDocument"]=> 62 NULL 63 ["parentNode"]=> 64 NULL 65 ["parentElement"]=> 66 NULL 67 ["childNodes"]=> 68 string(22) "(object value omitted)" 69 ["firstChild"]=> 70 string(22) "(object value omitted)" 71 ["lastChild"]=> 72 string(22) "(object value omitted)" 73 ["previousSibling"]=> 74 NULL 75 ["nextSibling"]=> 76 NULL 77 ["nodeValue"]=> 78 NULL 79 ["textContent"]=> 80 NULL 81} 82