xref: /PHP-7.4/ext/xmlreader/tests/001.phpt (revision d7a3edd4)
1--TEST--
2XMLReader: libxml2 XML Reader, string data
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$reader->XML($xmlstring);
13
14// Only go through
15while ($reader->read()) {
16	echo $reader->name."\n";
17}
18$xmlstring = '';
19$reader = new XMLReader();
20$reader->XML($xmlstring);
21?>
22===DONE===
23--EXPECTF--
24books
25books
26
27Warning: XMLReader::XML(): Empty string supplied as input in %s on line %d
28===DONE===
29