1--TEST--
2Passing an invalid character encoding
3--EXTENSIONS--
4xmlreader
5--FILE--
6<?php
7$reader = new XMLReader();
8try {
9    $reader->open(__FILE__, "does not exist");
10} catch (ValueError $e) {
11    echo $e->getMessage(), "\n";
12}
13
14$h = fopen("php://memory", "w+");
15try {
16    XMLReader::fromStream($h, encoding: "does not exist");
17} catch (ValueError $e) {
18    echo $e->getMessage(), "\n";
19}
20fclose($h);
21
22try {
23    $reader->XML('<?xml version="1.0"?><root/>', "does not exist");
24} catch (ValueError $e) {
25    echo $e->getMessage(), "\n";
26}
27?>
28--EXPECT--
29XMLReader::open(): Argument #2 ($encoding) must be a valid character encoding
30XMLReader::fromStream(): Argument #2 ($encoding) must be a valid character encoding
31XMLReader::XML(): Argument #2 ($encoding) must be a valid character encoding
32