1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
--TEST--
Dom\HTMLDocument::createCDATASection()
--EXTENSIONS--
dom
--FILE--
<?php
$dom = Dom\HTMLDocument::createEmpty();
try {
$dom->createCDATASection("foo");
} catch (DOMException $e) {
var_dump($e->getCode());
echo $e->getMessage(), "\n";
}
try {
$dom->createCDATASection("]]>");
} catch (DOMException $e) {
var_dump($e->getCode());
echo $e->getMessage(), "\n";
}
$dom = Dom\XMLDocument::createEmpty();
try {
$dom->createCDATASection("]]>");
} catch (DOMException $e) {
var_dump($e->getCode());
echo $e->getMessage(), "\n";
}
$dom->createCDATASection("]>");
?>
--EXPECT--
int(9)
This operation is not supported for HTML documents
int(9)
This operation is not supported for HTML documents
int(5)
Invalid character sequence "]]>" in CDATA section
|