blob: 9092740f150c4c65827591743351d483b052f90c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
--TEST--
XMLReader: libxml2 XML Reader, file data
--SKIPIF--
<?php if (!extension_loaded("xmlreader")) print "skip"; ?>
--FILE--
<?php
$filename = __DIR__ . '/_002.xml';
$xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
<books></books>';
file_put_contents($filename, $xmlstring);
$reader = new XMLReader();
if ($reader->open('')) exit();
$reader = new XMLReader();
if (!$reader->open($filename)) {
$reader->close();
exit();
}
// Only go through
while ($reader->read()) {
echo $reader->name."\n";
}
$reader->close();
unlink($filename);
touch($filename);
$reader = new XMLReader();
$reader->open($filename);
$reader->close();
unlink($filename);
?>
--EXPECTF--
Warning: XMLReader::open(): Empty string supplied as input in %s on line %d
books
books
|