File: params002.phpt

package info (click to toggle)
php-pecl-http 3.1.0%2B2.6.0-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,060 kB
  • ctags: 3,725
  • sloc: ansic: 37,486; xml: 818; php: 635; pascal: 164; makefile: 2
file content (58 lines) | stat: -rw-r--r-- 831 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
--TEST--
query parser
--SKIPIF--
<?php
include "skipif.inc";
?>
--FILE--
<?php
$p = new http\Params("foo=bar&arr[]=1&arr[]=2", array("&",";"), "", "=", http\Params::PARSE_QUERY);

var_dump($p); 

echo $p, "\n";
?>
DONE
--EXPECTF--
object(http\Params)#%d (5) {
  ["params"]=>
  array(2) {
    ["foo"]=>
    array(2) {
      ["value"]=>
      string(3) "bar"
      ["arguments"]=>
      array(0) {
      }
    }
    ["arr"]=>
    array(2) {
      ["value"]=>
      array(2) {
        [0]=>
        string(1) "1"
        [1]=>
        string(1) "2"
      }
      ["arguments"]=>
      array(0) {
      }
    }
  }
  ["param_sep"]=>
  array(2) {
    [0]=>
    string(1) "&"
    [1]=>
    string(1) ";"
  }
  ["arg_sep"]=>
  string(0) ""
  ["val_sep"]=>
  string(1) "="
  ["flags"]=>
  int(12)
}
foo=bar&arr%5B0%5D=1&arr%5B1%5D=2
DONE