1
0
mirror of https://github.com/php/php-src.git synced 2026-03-25 16:52:18 +01:00
Files
archived-php-src/ext/mbstring/tests/bug76704.phpt
George Peter Banyard fa3b8c75fb Promote unknown encoding throws in encoding array/string list
For the string list we emit still emit a warning by comparing arg_num to 0

Closes GH-5337
2020-04-03 10:58:46 +02:00

23 lines
601 B
PHP

--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"