xref: /PHP-8.0/ext/xmlreader/tests/011.phpt (revision a555cc0b)
1--TEST--
2XMLReader: libxml2 XML Reader, string data
3--SKIPIF--
4<?php if (!extension_loaded("xmlreader")) print "skip";
5$reader = new XMLReader();
6if (!method_exists($reader, 'readInnerXml')) print "skip";
7?>
8--FILE--
9<?php
10
11$xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
12<books><book>test</book></books>';
13
14$reader = new XMLReader();
15$reader->XML($xmlstring);
16$reader->read();
17echo $reader->readInnerXml();
18echo "\n";
19$reader->close();
20
21
22$reader = new XMLReader();
23$reader->XML($xmlstring);
24$reader->read();
25echo $reader->readOuterXml();
26echo "\n";
27$reader->close();
28?>
29--EXPECT--
30<book>test</book>
31<books><book>test</book></books>
32