2008-05-16 17:14:57 +00:00
|
|
|
--TEST--
|
|
|
|
Testing DOMDocumentFragment::appendXML and DOMDocumentFragment::hasChildNodes
|
2021-03-22 20:57:47 +00:00
|
|
|
--EXTENSIONS--
|
|
|
|
dom
|
2008-05-16 17:14:57 +00:00
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
$doc = new DOMDocument();
|
|
|
|
|
|
|
|
$fragment = $doc->createDocumentFragment();
|
|
|
|
if ($fragment->hasChildNodes()) {
|
|
|
|
echo "has child nodes\n";
|
|
|
|
} else {
|
|
|
|
echo "has no child nodes\n";
|
|
|
|
}
|
|
|
|
$fragment->appendXML('<foo>bar</foo>');
|
|
|
|
if ($fragment->hasChildNodes()) {
|
|
|
|
echo "has child nodes\n";
|
|
|
|
} else {
|
|
|
|
echo "has no child nodes\n";
|
|
|
|
}
|
2020-08-09 09:06:57 +00:00
|
|
|
?>
|
2008-05-16 17:14:57 +00:00
|
|
|
--EXPECT--
|
|
|
|
has no child nodes
|
|
|
|
has child nodes
|