mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
c2bdaa48e1
Passing `null` to `$encodings` is supposed to behave like passing the result of `mb_detect_order()`. Therefore, we need to remove the non- encodings from the `elist` in this case as well. Thus, we duplicate the global `elist`, so we can modify it. Closes GH-9063.
25 lines
365 B
PHP
25 lines
365 B
PHP
--TEST--
|
|
GH-9008 (mb_detect_encoding(): wrong results with null $encodings)
|
|
--EXTENSIONS--
|
|
mbstring
|
|
--FILE--
|
|
<?php
|
|
$string = "<?php
|
|
|
|
function test()
|
|
{
|
|
|
|
}
|
|
";
|
|
|
|
mb_detect_order(["ASCII", "UUENCODE"]);
|
|
|
|
var_dump(
|
|
mb_detect_encoding($string, null, true),
|
|
mb_detect_encoding($string, mb_detect_order(), true),
|
|
);
|
|
?>
|
|
--EXPECT--
|
|
string(5) "ASCII"
|
|
string(5) "ASCII"
|