1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/xmlreader/tests/001.phpt
Nikita Popov 7485978339 Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00

32 lines
537 B
PHP

--TEST--
XMLReader: libxml2 XML Reader, string data
--EXTENSIONS--
xmlreader
--FILE--
<?php
$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();
try {
$reader->XML($xmlstring);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
}
?>
--EXPECT--
books
books
XMLReader::XML(): Argument #1 ($source) cannot be empty