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