1--TEST--
2mb_http_input()
3--SKIPIF--
4<?php
5extension_loaded('mbstring') or die('skip mbstring not available');
6?>
7--POST--
8a=���ܸ�0123456789���ܸ쥫�����ʤҤ餬��
9--GET--
10b=���ܸ�0123456789���ܸ쥫�����ʤҤ餬��
11--INI--
12mbstring.encoding_translation=1
13input_encoding=latin1
14--FILE--
15<?php
16
17echo $_POST['a']."\n";
18echo $_GET['b']."\n";
19
20// Get encoding
21var_dump(mb_http_input('P'));
22var_dump(mb_http_input('G'));
23var_dump(mb_http_input('C'));
24var_dump(mb_http_input('S'));
25var_dump(mb_http_input('I'));
26var_dump(mb_http_input('L'));
27try {
28    var_dump(mb_http_input('Q'));
29} catch (ValueError $e) {
30    echo $e->getMessage(), "\n";
31}
32
33?>
34--EXPECT--
35ÆüËܸì0123456789ÆüËܸ쥫¥¿¥«¥Ê¤Ò¤é¤¬¤Ê
36ÆüËܸì0123456789ÆüËܸ쥫¥¿¥«¥Ê¤Ò¤é¤¬¤Ê
37string(10) "ISO-8859-1"
38string(10) "ISO-8859-1"
39bool(false)
40bool(false)
41array(1) {
42  [0]=>
43  string(10) "ISO-8859-1"
44}
45string(10) "ISO-8859-1"
46mb_http_input(): Argument #1 ($type) must be one of "G", "P", "C", "S", "I", or "L"
47