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 37
|
--TEST--
Dom\HTMLDocument::createProcessingInstruction()
--EXTENSIONS--
dom
--FILE--
<?php
$dom = Dom\HTMLDocument::createEmpty();
try {
$dom->createProcessingInstruction("?>", "");
} catch (DOMException $e) {
var_dump($e->getCode());
echo $e->getMessage(), "\n";
}
try {
$dom->createProcessingInstruction("?>", "?>");
} catch (DOMException $e) {
var_dump($e->getCode());
echo $e->getMessage(), "\n";
}
try {
$dom->createProcessingInstruction("target", "?>");
} catch (DOMException $e) {
var_dump($e->getCode());
echo $e->getMessage(), "\n";
}
$dom->appendChild($dom->createProcessingInstruction("foo", ""));
$dom->appendChild($dom->createProcessingInstruction("foo", "bar"));
echo $dom->saveHtml();
?>
--EXPECT--
int(5)
Invalid Character Error
int(5)
Invalid Character Error
int(5)
Invalid character sequence "?>" in processing instruction
<?foo ><?foo bar>
|