xref: /PHP-7.4/ext/xmlreader/tests/009.phpt (revision d7a3edd4)
1--TEST--
2XMLReader: libxml2 XML Reader, next
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><book num="1"><test /></book><book num="2" /></books>';
10
11$reader = new XMLReader();
12$reader->XML($xmlstring);
13
14// Only go through
15$reader->read();
16$reader->read();
17
18$reader->next();
19echo $reader->name;
20echo " ";
21echo $reader->getAttribute('num');
22echo "\n";
23?>
24===DONE===
25--EXPECT--
26book 2
27===DONE===
28