1--TEST--
2mb_parse_str() with multiple candidate encodings
3--EXTENSIONS--
4mbstring
5--INI--
6mbstring.http_input=UTF-8,SJIS,EUC-JP
7--FILE--
8<?php
9// The encoding of the input strings will be guessed, from the list specified
10// via mbstring.http_input
11// All of them will be converted to UTF-8
12mb_internal_encoding('UTF-8');
13
14$queries = array(
15  // UTF-8
16  "テスト=abc",
17  // SJIS
18  "\x82\xA0\x82\xA2\x82\xA4=\x93V"
19);
20
21foreach ($queries as $query) {
22  echo "Query: " . bin2hex($query) . "\n";
23
24  $array = [];
25  mb_parse_str($query, $array);
26
27  foreach ($array as $key => $value) {
28    echo bin2hex($key) . "=>" . bin2hex($value) . "\n";
29  }
30}
31
32?>
33--EXPECTF--
34Deprecated: PHP Startup: Use of mbstring.http_input is deprecated in %s on line %d
35Query: e38386e382b9e383883d616263
36e38386e382b9e38388=>616263
37Query: 82a082a282a43d9356
38e38182e38184e38186=>e5a4a9
39