1--TEST--
2XMLReader: Expand Error
3--EXTENSIONS--
4xmlreader
5dom
6--SKIPIF--
7<?php $reader = new XMLReader();
8if (!method_exists($reader, 'expand')) print "skip";
9?>
10--FILE--
11<?php
12
13$xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
14<books><book>new book</book></books>';
15
16$reader = new XMLReader();
17
18try {
19    $reader->expand();
20} catch (Error $exception) {
21    echo $exception->getMessage() . "\n";
22}
23
24$reader->close();
25
26$reader = new XMLReader();
27$reader->XML($xmlstring);
28var_dump($reader->expand());
29$reader->close();
30?>
31--EXPECTF--
32Data must be loaded before expanding
33
34Warning: XMLReader::expand(): An Error Occurred while expanding in %s on line %d
35bool(false)
36