1--TEST--
2stream_context_get_params()
3--FILE--
4<?php
5
6$ctx = stream_context_create();
7var_dump($ctx);
8var_dump(stream_context_get_params($ctx));
9
10var_dump(stream_context_set_option($ctx, "foo","bar","baz"));
11var_dump(stream_context_get_params($ctx));
12
13var_dump(stream_context_set_params($ctx, array("notification" => "stream_notification_callback")));
14var_dump(stream_context_get_params($ctx));
15
16var_dump(stream_context_set_params($ctx, array("notification" => array("stream","notification_callback"))));
17var_dump(stream_context_get_params($ctx));
18
19var_dump(stream_context_get_params($ctx));
20var_dump(stream_context_get_options($ctx));
21var_dump(stream_context_get_params($ctx));
22var_dump(stream_context_get_options($ctx));
23
24?>
25--EXPECTF--
26resource(%d) of type (stream-context)
27array(1) {
28  [%u|b%"options"]=>
29  array(0) {
30  }
31}
32bool(true)
33array(1) {
34  [%u|b%"options"]=>
35  array(1) {
36    [%u|b%"foo"]=>
37    array(1) {
38      [%u|b%"bar"]=>
39      %unicode|string%(3) "baz"
40    }
41  }
42}
43bool(true)
44array(2) {
45  [%u|b%"notification"]=>
46  %unicode|string%(28) "stream_notification_callback"
47  [%u|b%"options"]=>
48  array(1) {
49    [%u|b%"foo"]=>
50    array(1) {
51      [%u|b%"bar"]=>
52      %unicode|string%(3) "baz"
53    }
54  }
55}
56bool(true)
57array(2) {
58  [%u|b%"notification"]=>
59  array(2) {
60    [0]=>
61    %unicode|string%(6) "stream"
62    [1]=>
63    %unicode|string%(21) "notification_callback"
64  }
65  [%u|b%"options"]=>
66  array(1) {
67    [%u|b%"foo"]=>
68    array(1) {
69      [%u|b%"bar"]=>
70      %unicode|string%(3) "baz"
71    }
72  }
73}
74array(2) {
75  [%u|b%"notification"]=>
76  array(2) {
77    [0]=>
78    %unicode|string%(6) "stream"
79    [1]=>
80    %unicode|string%(21) "notification_callback"
81  }
82  [%u|b%"options"]=>
83  array(1) {
84    [%u|b%"foo"]=>
85    array(1) {
86      [%u|b%"bar"]=>
87      %unicode|string%(3) "baz"
88    }
89  }
90}
91array(1) {
92  [%u|b%"foo"]=>
93  array(1) {
94    [%u|b%"bar"]=>
95    %unicode|string%(3) "baz"
96  }
97}
98array(2) {
99  [%u|b%"notification"]=>
100  array(2) {
101    [0]=>
102    %unicode|string%(6) "stream"
103    [1]=>
104    %unicode|string%(21) "notification_callback"
105  }
106  [%u|b%"options"]=>
107  array(1) {
108    [%u|b%"foo"]=>
109    array(1) {
110      [%u|b%"bar"]=>
111      %unicode|string%(3) "baz"
112    }
113  }
114}
115array(1) {
116  [%u|b%"foo"]=>
117  array(1) {
118    [%u|b%"bar"]=>
119    %unicode|string%(3) "baz"
120  }
121}
122