xref: /PHP-7.3/ext/mbstring/tests/bug48697.phpt (revision ca927bb4)
1--TEST--
2Bug #48697 (mb_internal_encoding() value gets reset by parse_str() or mb_parse_str()
3--SKIPIF--
4<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
5--INI--
6error_reporting=E_ALL & ~E_DEPRECATED
7--FILE--
8<?php
9ini_set('mbstring.internal_encoding', 'ISO-8859-15');
10ini_set('mbstring.encoding_translation', true);
11var_dump(mb_internal_encoding());
12mb_internal_encoding('UTF-8');
13var_dump(mb_internal_encoding());
14parse_str('a=b');
15var_dump(mb_internal_encoding());
16mb_internal_encoding('UTF-8');
17var_dump(mb_internal_encoding());
18parse_str('a=b');
19var_dump(mb_internal_encoding());
20?>
21--EXPECT--
22string(11) "ISO-8859-15"
23string(5) "UTF-8"
24string(5) "UTF-8"
25string(5) "UTF-8"
26string(5) "UTF-8"
27