xref: /PHP-8.3/ext/xmlreader/tests/009.phpt (revision 74859783)
1--TEST--
2XMLReader: libxml2 XML Reader, next
3--EXTENSIONS--
4xmlreader
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--EXPECT--
25book 2
26