xref: /PHP-8.3/ext/mbstring/tests/bug76704.phpt (revision 74859783)
1--TEST--
2Bug #76704 (mb_detect_order return value varies based on argument type)
3--EXTENSIONS--
4mbstring
5--FILE--
6<?php
7try {
8    var_dump(mb_detect_order('Foo, UTF-8'));
9} catch (\ValueError $e) {
10    echo $e->getMessage() . \PHP_EOL;
11}
12try {
13    var_dump(mb_detect_order(['Foo', 'UTF-8']));
14} catch (\ValueError $e) {
15    echo $e->getMessage() . \PHP_EOL;
16}
17?>
18--EXPECT--
19mb_detect_order(): Argument #1 ($encoding) contains invalid encoding "Foo"
20mb_detect_order(): Argument #1 ($encoding) contains invalid encoding "Foo"
21