summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/mbstring/tests/bug48697.phpt24
1 files changed, 24 insertions, 0 deletions
diff --git a/ext/mbstring/tests/bug48697.phpt b/ext/mbstring/tests/bug48697.phpt
new file mode 100644
index 0000000000..42bbe9f5a8
--- /dev/null
+++ b/ext/mbstring/tests/bug48697.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #48697 (mb_internal_encoding() value gets reset by parse_str() or mb_parse_str()
+--SKIPIF--
+<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
+--FILE--
+<?php
+ini_set('mbstring.internal_encoding', 'ISO-8859-15');
+ini_set('mbstring.encoding_translation', true);
+var_dump(mb_internal_encoding());
+mb_internal_encoding('UTF-8');
+var_dump(mb_internal_encoding());
+parse_str('a=b');
+var_dump(mb_internal_encoding());
+mb_internal_encoding('UTF-8');
+var_dump(mb_internal_encoding());
+parse_str('a=b');
+var_dump(mb_internal_encoding());
+?>
+--EXPECT--
+string(11) "ISO-8859-15"
+string(5) "UTF-8"
+string(5) "UTF-8"
+string(5) "UTF-8"
+string(5) "UTF-8"