mirror of
https://github.com/php/php-src.git
synced 2024-11-25 02:44:58 +08:00
30 lines
545 B
PHP
30 lines
545 B
PHP
--TEST--
|
|
XMLReader: libxml2 XML Reader, string data
|
|
--SKIPIF--
|
|
<?php if (!extension_loaded("xmlreader")) print "skip"; ?>
|
|
--FILE--
|
|
<?php
|
|
/* $Id$ */
|
|
|
|
$xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
|
|
<books></books>';
|
|
|
|
$reader = new XMLReader();
|
|
$reader->XML($xmlstring);
|
|
|
|
// Only go through
|
|
while ($reader->read()) {
|
|
echo $reader->name."\n";
|
|
}
|
|
$xmlstring = '';
|
|
$reader = new XMLReader();
|
|
$reader->XML($xmlstring);
|
|
?>
|
|
===DONE===
|
|
--EXPECTF--
|
|
books
|
|
books
|
|
|
|
Warning: XMLReader::XML(): Empty string supplied as input in %s on line %d
|
|
===DONE===
|