@ 2014-04-06T19:33:50Z <?php
$html = '<!DOCTYPE html>
<html dir="ltr" lang="en-US">testing
<head>la</head>testing1<body>um<p id="test">laaa</p></body></html>';
$dom = new DOMDocument;
$dom->loadHTML($html);
var_dump($dom);
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 8.3.0 - 8.3.6 Warning: DOMDocument::loadHTML(): htmlParseStartTag: misplaced <head> tag in Entity, line: 3 in /in/fnI17 on line 6
Warning: DOMDocument::loadHTML(): htmlParseStartTag: misplaced <body> tag in Entity, line: 3 in /in/fnI17 on line 6
object(DOMDocument)#1 (40) {
["doctype"]=>
string(22) "(object value omitted)"
["implementation"]=>
string(22) "(object value omitted)"
["documentElement"]=>
string(22) "(object value omitted)"
["actualEncoding"]=>
NULL
["encoding"]=>
NULL
["xmlEncoding"]=>
NULL
["standalone"]=>
bool(true)
["xmlStandalone"]=>
bool(true)
["version"]=>
NULL
["xmlVersion"]=>
NULL
["strictErrorChecking"]=>
bool(true)
["documentURI"]=>
NULL
["config"]=>
NULL
["formatOutput"]=>
bool(false)
["validateOnParse"]=>
bool(false)
["resolveExternals"]=>
bool(false)
["preserveWhiteSpace"]=>
bool(true)
["recover"]=>
bool(false)
["substituteEntities"]=>
bool(false)
["firstElementChild"]=>
string(22) "(object value omitted)"
["lastElementChild"]=>
string(22) "(object value omitted)"
["childElementCount"]=>
int(1)
["nodeName"]=>
string(9) "#document"
["nodeValue"]=>
NULL
["nodeType"]=>
int(13)
["parentNode"]=>
NULL
["parentElement"]=>
NULL
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
string(22) "(object value omitted)"
["lastChild"]=>
string(22) "(object value omitted)"
["previousSibling"]=>
NULL
["nextSibling"]=>
NULL
["attributes"]=>
NULL
["isConnected"]=>
bool(true)
["ownerDocument"]=>
NULL
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
NULL
["baseURI"]=>
NULL
["textContent"]=>
string(24) "testing
latesting1umlaaa"
}
Output for 8.0.0 - 8.0.30 , 8.1.23 - 8.1.28 , 8.2.10 - 8.2.18 Warning: DOMDocument::loadHTML(): htmlParseStartTag: misplaced <head> tag in Entity, line: 3 in /in/fnI17 on line 6
Warning: DOMDocument::loadHTML(): htmlParseStartTag: misplaced <body> tag in Entity, line: 3 in /in/fnI17 on line 6
object(DOMDocument)#1 (38) {
["doctype"]=>
string(22) "(object value omitted)"
["implementation"]=>
string(22) "(object value omitted)"
["documentElement"]=>
string(22) "(object value omitted)"
["actualEncoding"]=>
NULL
["encoding"]=>
NULL
["xmlEncoding"]=>
NULL
["standalone"]=>
bool(true)
["xmlStandalone"]=>
bool(true)
["version"]=>
NULL
["xmlVersion"]=>
NULL
["strictErrorChecking"]=>
bool(true)
["documentURI"]=>
NULL
["config"]=>
NULL
["formatOutput"]=>
bool(false)
["validateOnParse"]=>
bool(false)
["resolveExternals"]=>
bool(false)
["preserveWhiteSpace"]=>
bool(true)
["recover"]=>
bool(false)
["substituteEntities"]=>
bool(false)
["firstElementChild"]=>
string(22) "(object value omitted)"
["lastElementChild"]=>
string(22) "(object value omitted)"
["childElementCount"]=>
int(1)
["nodeName"]=>
string(9) "#document"
["nodeValue"]=>
NULL
["nodeType"]=>
int(13)
["parentNode"]=>
NULL
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
string(22) "(object value omitted)"
["lastChild"]=>
string(22) "(object value omitted)"
["previousSibling"]=>
NULL
["nextSibling"]=>
NULL
["attributes"]=>
NULL
["ownerDocument"]=>
NULL
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
NULL
["baseURI"]=>
NULL
["textContent"]=>
string(24) "testing
latesting1umlaaa"
}
Output for 8.1.0 - 8.1.22 , 8.2.0 - 8.2.9 Warning: DOMDocument::loadHTML(): htmlParseStartTag: misplaced <head> tag in Entity, line: 3 in /in/fnI17 on line 6
Warning: DOMDocument::loadHTML(): htmlParseStartTag: misplaced <body> tag in Entity, line: 3 in /in/fnI17 on line 6
object(DOMDocument)#1 (38) {
["config"]=>
NULL
["doctype"]=>
string(22) "(object value omitted)"
["implementation"]=>
string(22) "(object value omitted)"
["documentElement"]=>
string(22) "(object value omitted)"
["actualEncoding"]=>
NULL
["encoding"]=>
NULL
["xmlEncoding"]=>
NULL
["standalone"]=>
bool(true)
["xmlStandalone"]=>
bool(true)
["version"]=>
NULL
["xmlVersion"]=>
NULL
["strictErrorChecking"]=>
bool(true)
["documentURI"]=>
NULL
["formatOutput"]=>
bool(false)
["validateOnParse"]=>
bool(false)
["resolveExternals"]=>
bool(false)
["preserveWhiteSpace"]=>
bool(true)
["recover"]=>
bool(false)
["substituteEntities"]=>
bool(false)
["firstElementChild"]=>
string(22) "(object value omitted)"
["lastElementChild"]=>
string(22) "(object value omitted)"
["childElementCount"]=>
int(1)
["nodeName"]=>
string(9) "#document"
["nodeValue"]=>
NULL
["nodeType"]=>
int(13)
["parentNode"]=>
NULL
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
string(22) "(object value omitted)"
["lastChild"]=>
string(22) "(object value omitted)"
["previousSibling"]=>
NULL
["nextSibling"]=>
NULL
["attributes"]=>
NULL
["ownerDocument"]=>
NULL
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
NULL
["baseURI"]=>
NULL
["textContent"]=>
string(24) "testing
latesting1umlaaa"
}
Output for 7.0.20 , 7.1.5 - 7.1.20 , 7.2.6 - 7.2.33 , 7.3.12 - 7.3.33 , 7.4.0 - 7.4.33 Warning: DOMDocument::loadHTML(): htmlParseStartTag: misplaced <head> tag in Entity, line: 3 in /in/fnI17 on line 6
Warning: DOMDocument::loadHTML(): htmlParseStartTag: misplaced <body> tag in Entity, line: 3 in /in/fnI17 on line 6
object(DOMDocument)#1 (35) {
["doctype"]=>
string(22) "(object value omitted)"
["implementation"]=>
string(22) "(object value omitted)"
["documentElement"]=>
string(22) "(object value omitted)"
["actualEncoding"]=>
NULL
["encoding"]=>
NULL
["xmlEncoding"]=>
NULL
["standalone"]=>
bool(true)
["xmlStandalone"]=>
bool(true)
["version"]=>
NULL
["xmlVersion"]=>
NULL
["strictErrorChecking"]=>
bool(true)
["documentURI"]=>
NULL
["config"]=>
NULL
["formatOutput"]=>
bool(false)
["validateOnParse"]=>
bool(false)
["resolveExternals"]=>
bool(false)
["preserveWhiteSpace"]=>
bool(true)
["recover"]=>
bool(false)
["substituteEntities"]=>
bool(false)
["nodeName"]=>
string(9) "#document"
["nodeValue"]=>
NULL
["nodeType"]=>
int(13)
["parentNode"]=>
NULL
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
string(22) "(object value omitted)"
["lastChild"]=>
string(22) "(object value omitted)"
["previousSibling"]=>
NULL
["nextSibling"]=>
NULL
["attributes"]=>
NULL
["ownerDocument"]=>
NULL
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
NULL
["baseURI"]=>
NULL
["textContent"]=>
string(24) "testing
latesting1umlaaa"
}
Output for 5.3.11 - 5.3.29 , 5.4.1 - 5.4.45 , 5.5.24 - 5.5.35 , 5.6.8 - 5.6.28 , 7.0.0 - 7.0.14 , 7.1.0 Warning: DOMDocument::loadHTML(): htmlParseStartTag: misplaced <head> tag in Entity, line: 3 in /in/fnI17 on line 6
Warning: DOMDocument::loadHTML(): htmlParseStartTag: misplaced <body> tag in Entity, line: 3 in /in/fnI17 on line 6
object(DOMDocument)#1 (34) {
["doctype"]=>
string(22) "(object value omitted)"
["implementation"]=>
string(22) "(object value omitted)"
["documentElement"]=>
string(22) "(object value omitted)"
["actualEncoding"]=>
NULL
["encoding"]=>
NULL
["xmlEncoding"]=>
NULL
["standalone"]=>
bool(true)
["xmlStandalone"]=>
bool(true)
["version"]=>
NULL
["xmlVersion"]=>
NULL
["strictErrorChecking"]=>
bool(true)
["documentURI"]=>
NULL
["config"]=>
NULL
["formatOutput"]=>
bool(false)
["validateOnParse"]=>
bool(false)
["resolveExternals"]=>
bool(false)
["preserveWhiteSpace"]=>
bool(true)
["recover"]=>
bool(false)
["substituteEntities"]=>
bool(false)
["nodeName"]=>
string(9) "#document"
["nodeValue"]=>
NULL
["nodeType"]=>
int(13)
["parentNode"]=>
NULL
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
string(22) "(object value omitted)"
["lastChild"]=>
string(22) "(object value omitted)"
["previousSibling"]=>
NULL
["attributes"]=>
NULL
["ownerDocument"]=>
NULL
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
NULL
["baseURI"]=>
NULL
["textContent"]=>
string(24) "testing
latesting1umlaaa"
}
Output for 5.0.0 - 5.0.5 , 5.1.0 - 5.1.6 , 5.2.0 - 5.2.17 , 5.3.0 - 5.3.10 , 5.4.0 Warning: DOMDocument::loadHTML(): htmlParseStartTag: misplaced <head> tag in Entity, line: 3 in /in/fnI17 on line 6
Warning: DOMDocument::loadHTML(): htmlParseStartTag: misplaced <body> tag in Entity, line: 3 in /in/fnI17 on line 6
object(DOMDocument)#1 (0) {
}
Output for 4.3.2 - 4.3.11 , 4.4.0 - 4.4.9 Fatal error: Cannot instantiate non-existent class: domdocument in /in/fnI17 on line 5
Process exited with code 255 . Output for 4.3.0 - 4.3.1 Fatal error: Cannot instantiate non-existent class: domdocument in /in/fnI17 on line 5
preferences:dark mode live preview
221.43 ms | 401 KiB | 312 Q