summaryrefslogtreecommitdiff
path: root/ext/mbstring/tests/bug76704.phpt
blob: 5a58f9ff202765b90aa6beb5ad50ca8d49fbf4e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--TEST--
Bug #76704 (mb_detect_order return value varies based on argument type)
--SKIPIF--
<?php
if (!extension_loaded('mbstring')) die('skip mbstring extension not available');
?>
--FILE--
<?php
try {
    var_dump(mb_detect_order('Foo, UTF-8'));
} catch (\ValueError $e) {
    echo $e->getMessage() . \PHP_EOL;
}
try {
    var_dump(mb_detect_order(['Foo', 'UTF-8']));
} catch (\ValueError $e) {
    echo $e->getMessage() . \PHP_EOL;
}
?>
--EXPECT--
mb_detect_order(): Argument #1 ($encoding) contains invalid encoding "Foo"
mb_detect_order(): Argument #1 ($encoding) contains invalid encoding "Foo"