1--TEST--
2mb_encoding_aliases()
3--EXTENSIONS--
4mbstring
5--FILE--
6<?php
7$list = mb_encoding_aliases("ASCII");
8sort($list);
9var_dump($list);
10var_dump(mb_encoding_aliases("7bit"));
11var_dump(mb_encoding_aliases("8bit"));
12
13try {
14    var_dump(mb_encoding_aliases("BAD"));
15} catch (\ValueError $e) {
16    echo $e->getMessage() . \PHP_EOL;
17}
18?>
19--EXPECT--
20array(11) {
21  [0]=>
22  string(14) "ANSI_X3.4-1968"
23  [1]=>
24  string(14) "ANSI_X3.4-1986"
25  [2]=>
26  string(7) "IBM-367"
27  [3]=>
28  string(6) "IBM367"
29  [4]=>
30  string(9) "ISO646-US"
31  [5]=>
32  string(16) "ISO_646.irv:1991"
33  [6]=>
34  string(8) "US-ASCII"
35  [7]=>
36  string(5) "cp367"
37  [8]=>
38  string(7) "csASCII"
39  [9]=>
40  string(8) "iso-ir-6"
41  [10]=>
42  string(2) "us"
43}
44array(0) {
45}
46array(1) {
47  [0]=>
48  string(6) "binary"
49}
50mb_encoding_aliases(): Argument #1 ($encoding) must be a valid encoding, "BAD" given
51