1--TEST--
2Dom\XMLDocument::createFromString 03
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$flags = [
9    LIBXML_RECOVER, LIBXML_NOENT, LIBXML_DTDLOAD, LIBXML_DTDATTR, LIBXML_DTDVALID, LIBXML_NOERROR, LIBXML_NOWARNING, LIBXML_NOBLANKS, LIBXML_XINCLUDE, LIBXML_NSCLEAN, LIBXML_NOCDATA, LIBXML_NONET, LIBXML_PEDANTIC, LIBXML_COMPACT, LIBXML_PARSEHUGE, LIBXML_BIGLINES
10];
11
12try {
13    Dom\XMLDocument::createFromString('<?xml version="1.0"?><container/>', -1);
14} catch (ValueError $e) {
15    echo $e->getMessage(), "\n";
16}
17
18foreach ($flags as $flag) {
19    var_dump(Dom\XMLDocument::createFromString('<?xml version="1.0"?><container/>', $flag) instanceof Dom\XMLDocument);
20}
21
22?>
23--EXPECTF--
24Dom\XMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: %s)
25bool(true)
26bool(true)
27bool(true)
28bool(true)
29bool(true)
30bool(true)
31bool(true)
32bool(true)
33bool(true)
34bool(true)
35bool(true)
36bool(true)
37bool(true)
38bool(true)
39bool(true)
40bool(true)
41