1--TEST--
2Dom\HTMLDocument::createProcessingInstruction()
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$dom = Dom\HTMLDocument::createEmpty();
8try {
9    $dom->createProcessingInstruction("?>", "");
10} catch (DOMException $e) {
11    var_dump($e->getCode());
12    echo $e->getMessage(), "\n";
13}
14try {
15    $dom->createProcessingInstruction("?>", "?>");
16} catch (DOMException $e) {
17    var_dump($e->getCode());
18    echo $e->getMessage(), "\n";
19}
20try {
21    $dom->createProcessingInstruction("target", "?>");
22} catch (DOMException $e) {
23    var_dump($e->getCode());
24    echo $e->getMessage(), "\n";
25}
26$dom->appendChild($dom->createProcessingInstruction("foo", ""));
27$dom->appendChild($dom->createProcessingInstruction("foo", "bar"));
28echo $dom->saveHtml();
29?>
30--EXPECT--
31int(5)
32Invalid Character Error
33int(5)
34Invalid Character Error
35int(5)
36Invalid character sequence "?>" in processing instruction
37<?foo ><?foo bar>
38