xref: /PHP-8.2/ext/xmlreader/tests/static.phpt (revision 74859783)
1--TEST--
2Calling XMLReader::open() and ::XML() statically
3--EXTENSIONS--
4xmlreader
5--FILE--
6<?php
7$filename = __DIR__ . '/static.xml';
8
9$xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
10<books></books>';
11file_put_contents($filename, $xmlstring);
12
13$reader = XMLReader::open($filename);
14while ($reader->read()) {
15    echo $reader->name, "\n";
16}
17
18$reader = XMLReader::XML($xmlstring);
19while ($reader->read()) {
20    echo $reader->name, "\n";
21}
22?>
23--EXPECT--
24books
25books
26books
27books
28--CLEAN--
29<?php
30unlink(__DIR__ . '/static.xml');
31?>
32