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