1--TEST--
2Test mb_regex_encoding() function : error conditions - Pass an unknown encoding
3--EXTENSIONS--
4mbstring
5--SKIPIF--
6<?php
7function_exists('mb_regex_encoding') or die("skip mb_regex_encoding() is not available in this build");
8?>
9--FILE--
10<?php
11/*
12 * Pass mb_regex_encoding an unknown type of encoding
13 */
14
15echo "*** Testing mb_regex_encoding() : error conditions ***\n";
16
17try {
18    var_dump(mb_regex_encoding('unknown'));
19} catch (\ValueError $e) {
20    echo $e->getMessage() . \PHP_EOL;
21}
22
23?>
24--EXPECT--
25*** Testing mb_regex_encoding() : error conditions ***
26mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "unknown" given
27