xref: /PHP-8.0/ext/xmlreader/tests/005.phpt (revision f8d79582)
1--TEST--
2XMLReader: libxml2 XML Reader, parser property set/get
3--SKIPIF--
4<?php if (!extension_loaded("xmlreader")) print "skip"; ?>
5--FILE--
6<?php
7
8$xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
9<books></books>';
10
11$reader = new XMLReader();
12
13$reader->XML($xmlstring);
14
15
16$a = $reader->setParserProperty(XMLReader::LOADDTD, false);
17$b = $reader->getParserProperty(XMLReader::LOADDTD);
18
19if (!$a && !$b) {
20    echo "ok\n";
21}
22
23$a = $reader->setParserProperty(XMLReader::SUBST_ENTITIES, true);
24$b = $reader->getParserProperty(XMLReader::SUBST_ENTITIES);
25
26if ($a && $b) {
27    echo "ok\n";
28}
29// Only go through
30while ($reader->read());
31$reader->close();
32?>
33--EXPECT--
34ok
35