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