xref: /PHP-5.6/ext/mbstring/tests/mb_get_info.phpt (revision c7cebbf7)
1--TEST--
2Test mb_get_info() function
3--SKIPIF--
4<?php extension_loaded('mbstring') or die('skip'); ?>
5--INI--
6mbstring.encoding_translation=1
7mbstring.language=Korean
8mbstring.internal_encoding=UTF-8
9mbstring.http_input=ISO-8859-1
10mbstring.http_output=ISO-8859-15
11mbstring.http_output_conv_mimetypes=abc
12mbstring.func_overload=2
13mbstring.detect_order=UTF-8,ISO-8859-15,ISO-8859-1,ASCII
14mbstring.substitute_character=123
15mbstring.strict_detection=1
16--FILE--
17<?php
18mb_parse_str("abc=def", $dummy);
19mb_convert_encoding("\xff\xff", "Shift_JIS", "UCS-2BE");
20$result = mb_get_info();
21var_dump($result);
22foreach (array_keys($result) as $key) {
23    var_dump($result[$key], mb_get_info($key));
24}
25?>
26--EXPECT--
27array(15) {
28  ["internal_encoding"]=>
29  string(5) "UTF-8"
30  ["http_input"]=>
31  string(10) "ISO-8859-1"
32  ["http_output"]=>
33  string(11) "ISO-8859-15"
34  ["http_output_conv_mimetypes"]=>
35  string(3) "abc"
36  ["func_overload"]=>
37  int(2)
38  ["func_overload_list"]=>
39  array(12) {
40    ["strlen"]=>
41    string(9) "mb_strlen"
42    ["strpos"]=>
43    string(9) "mb_strpos"
44    ["strrpos"]=>
45    string(10) "mb_strrpos"
46    ["stripos"]=>
47    string(10) "mb_stripos"
48    ["strripos"]=>
49    string(11) "mb_strripos"
50    ["strstr"]=>
51    string(9) "mb_strstr"
52    ["strrchr"]=>
53    string(10) "mb_strrchr"
54    ["stristr"]=>
55    string(10) "mb_stristr"
56    ["substr"]=>
57    string(9) "mb_substr"
58    ["strtolower"]=>
59    string(13) "mb_strtolower"
60    ["strtoupper"]=>
61    string(13) "mb_strtoupper"
62    ["substr_count"]=>
63    string(15) "mb_substr_count"
64  }
65  ["mail_charset"]=>
66  string(11) "ISO-2022-KR"
67  ["mail_header_encoding"]=>
68  string(6) "BASE64"
69  ["mail_body_encoding"]=>
70  string(4) "7bit"
71  ["illegal_chars"]=>
72  int(1)
73  ["encoding_translation"]=>
74  string(2) "On"
75  ["language"]=>
76  string(6) "Korean"
77  ["detect_order"]=>
78  array(4) {
79    [0]=>
80    string(5) "UTF-8"
81    [1]=>
82    string(11) "ISO-8859-15"
83    [2]=>
84    string(10) "ISO-8859-1"
85    [3]=>
86    string(5) "ASCII"
87  }
88  ["substitute_character"]=>
89  int(123)
90  ["strict_detection"]=>
91  string(2) "On"
92}
93string(5) "UTF-8"
94string(5) "UTF-8"
95string(10) "ISO-8859-1"
96string(10) "ISO-8859-1"
97string(11) "ISO-8859-15"
98string(11) "ISO-8859-15"
99string(3) "abc"
100string(3) "abc"
101int(2)
102int(2)
103array(12) {
104  ["strlen"]=>
105  string(9) "mb_strlen"
106  ["strpos"]=>
107  string(9) "mb_strpos"
108  ["strrpos"]=>
109  string(10) "mb_strrpos"
110  ["stripos"]=>
111  string(10) "mb_stripos"
112  ["strripos"]=>
113  string(11) "mb_strripos"
114  ["strstr"]=>
115  string(9) "mb_strstr"
116  ["strrchr"]=>
117  string(10) "mb_strrchr"
118  ["stristr"]=>
119  string(10) "mb_stristr"
120  ["substr"]=>
121  string(9) "mb_substr"
122  ["strtolower"]=>
123  string(13) "mb_strtolower"
124  ["strtoupper"]=>
125  string(13) "mb_strtoupper"
126  ["substr_count"]=>
127  string(15) "mb_substr_count"
128}
129array(12) {
130  ["strlen"]=>
131  string(9) "mb_strlen"
132  ["strpos"]=>
133  string(9) "mb_strpos"
134  ["strrpos"]=>
135  string(10) "mb_strrpos"
136  ["stripos"]=>
137  string(10) "mb_stripos"
138  ["strripos"]=>
139  string(11) "mb_strripos"
140  ["strstr"]=>
141  string(9) "mb_strstr"
142  ["strrchr"]=>
143  string(10) "mb_strrchr"
144  ["stristr"]=>
145  string(10) "mb_stristr"
146  ["substr"]=>
147  string(9) "mb_substr"
148  ["strtolower"]=>
149  string(13) "mb_strtolower"
150  ["strtoupper"]=>
151  string(13) "mb_strtoupper"
152  ["substr_count"]=>
153  string(15) "mb_substr_count"
154}
155string(11) "ISO-2022-KR"
156string(11) "ISO-2022-KR"
157string(6) "BASE64"
158string(6) "BASE64"
159string(4) "7bit"
160string(4) "7bit"
161int(1)
162int(1)
163string(2) "On"
164string(2) "On"
165string(6) "Korean"
166string(6) "Korean"
167array(4) {
168  [0]=>
169  string(5) "UTF-8"
170  [1]=>
171  string(11) "ISO-8859-15"
172  [2]=>
173  string(10) "ISO-8859-1"
174  [3]=>
175  string(5) "ASCII"
176}
177array(4) {
178  [0]=>
179  string(5) "UTF-8"
180  [1]=>
181  string(11) "ISO-8859-15"
182  [2]=>
183  string(10) "ISO-8859-1"
184  [3]=>
185  string(5) "ASCII"
186}
187int(123)
188int(123)
189string(2) "On"
190string(2) "On"
191