xref: /PHP-8.2/ext/dom/tests/gh11791.phpt (revision bf4e7bd3)
1--TEST--
2GH-11791 (Wrong default value of DOMDocument.xmlStandalone)
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$doc = new DOMDocument();
8$doc->loadXML('<root/>');
9var_dump($doc->xmlStandalone);
10$doc->xmlStandalone = true;
11var_dump($doc->xmlStandalone);
12
13$doc = new DOMDocument();
14$doc->loadXML('<?xml version="1.0"?><root/>');
15var_dump($doc->xmlStandalone);
16$doc->xmlStandalone = true;
17var_dump($doc->xmlStandalone);
18
19$doc = new DOMDocument();
20$doc->loadXML('<?xml version="1.0" standalone="no"?><root/>');
21var_dump($doc->xmlStandalone);
22$doc->xmlStandalone = true;
23var_dump($doc->xmlStandalone);
24
25$doc = new DOMDocument();
26$doc->loadXML('<?xml version="1.0" standalone="yes"?><root/>');
27var_dump($doc->xmlStandalone);
28$doc->xmlStandalone = false;
29var_dump($doc->xmlStandalone);
30?>
31--EXPECT--
32bool(false)
33bool(true)
34bool(false)
35bool(true)
36bool(false)
37bool(true)
38bool(true)
39bool(false)
40