xref: /PHP-8.0/ext/mbstring/tests/bug48697.phpt (revision ff780fec)
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--FILE--
6<?php
7ini_set('mbstring.internal_encoding', 'ISO-8859-15');
8ini_set('mbstring.encoding_translation', true);
9var_dump(mb_internal_encoding());
10mb_internal_encoding('UTF-8');
11var_dump(mb_internal_encoding());
12parse_str('a=b', $ary);
13var_dump(mb_internal_encoding());
14mb_internal_encoding('UTF-8');
15var_dump(mb_internal_encoding());
16parse_str('a=b', $ary);
17var_dump(mb_internal_encoding());
18?>
19--EXPECTF--
20Deprecated: ini_set(): Use of mbstring.internal_encoding is deprecated in %s on line %d
21string(11) "ISO-8859-15"
22string(5) "UTF-8"
23string(5) "UTF-8"
24string(5) "UTF-8"
25string(5) "UTF-8"
26