reference/stream/functions/stream-context-create.xml
29cf1ea0ec2d4ee04f723da66461a2f613e0876f
...
...
@@ -9,8 +9,8 @@
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
11
<type>resource</type><methodname>stream_context_create</methodname>
12
-
<methodparam choice="opt"><type>array</type><parameter>options</parameter></methodparam>
13
-
<methodparam choice="opt"><type>array</type><parameter>params</parameter></methodparam>
12
+
<methodparam choice="opt"><type class="union"><type>array</type><type>null</type></type><parameter>options</parameter><initializer>&null;</initializer></methodparam>
13
+
<methodparam choice="opt"><type class="union"><type>array</type><type>null</type></type><parameter>params</parameter><initializer>&null;</initializer></methodparam>
14
14
</methodsynopsis>
15
15
<para>
16
16
Creates and returns a stream context with any options supplied in
...
...
@@ -27,10 +27,10 @@
27
27
<listitem>
28
28
<para>
29
29
Must be an associative array of associative arrays in the format
30
-
<literal>$arr['wrapper']['option'] = $value</literal>.
30
+
<literal>$arr['wrapper']['option'] = $value</literal>, or &null;. Refer to <link linkend="context">context options</link> for a list of available wrappers and options.
31
31
</para>
32
32
<para>
33
-
Default to an empty array.
33
+
Defaults to &null;.
34
34
</para>
35
35
</listitem>
36
36
</varlistentry>
...
...
@@ -39,8 +39,8 @@
39
39
<listitem>
40
40
<para>
41
41
Must be an associative array in the format
42
-
<literal>$arr['parameter'] = $value</literal>.
43
-
Refer to <link linkend="context">context parameters</link> for
42
+
<literal>$arr['parameter'] = $value</literal>, or &null;.
43
+
Refer to <link linkend="context.params">context parameters</link> for
44
44
a listing of standard stream parameters.
45
45
</para>
46
46
</listitem>
...
...
@@ -58,26 +58,24 @@
58
58

59
59
<refsect1 role="changelog">
60
60
&reftitle.changelog;
61
-
<para>
62
-
<informaltable>
63
-
<tgroup cols="2">
64
-
<thead>
65
-
<row>
66
-
<entry>&Version;</entry>
67
-
<entry>&Description;</entry>
68
-
</row>
69
-
</thead>
70
-
<tbody>
71
-
<row>
72
-
<entry>5.3.0</entry>
73
-
<entry>
74
-
Added the optional <parameter>params</parameter> argument.
75
-
</entry>
76
-
</row>
77
-
</tbody>
78
-
</tgroup>
79
-
</informaltable>
80
-
</para>
61
+
<informaltable>
62
+
<tgroup cols="2">
63
+
<thead>
64
+
<row>
65
+
<entry>&Version;</entry>
66
+
<entry>&Description;</entry>
67
+
</row>
68
+
</thead>
69
+
<tbody>
70
+
<row>
71
+
<entry>8.0.0</entry>
72
+
<entry>
73
+
<parameter>options</parameter> and <parameter>params</parameter> are now nullable.
74
+
</entry>
75
+
</row>
76
+
</tbody>
77
+
</tgroup>
78
+
</informaltable>
81
79
</refsect1>
82
80

83
81
<refsect1 role="examples">
...
...
@@ -87,13 +85,13 @@
87
85
<programlisting role="php">
88
86
<![CDATA[
89
87
<?php
90
-
$opts = array(
91
-
'http'=>array(
92
-
'method'=>"GET",
93
-
'header'=>"Accept-language: en\r\n" .
94
-
"Cookie: foo=bar\r\n"
95
-
)
96
-
);
88
+
$opts = [
89
+
'http' => [
90
+
'method' => "GET",
91
+
// Use newline \n to separate multiple headers
92
+
'header' => "Accept-language: en\nCookie: foo=bar",
93
+
]
94
+
];
97
95

98
96
$context = stream_context_create($opts);
99
97

...
...
@@ -117,7 +115,6 @@ fclose($fp);
117
115
</simplelist>
118
116
</refsect1>
119
117
</refentry>
120
-

121
118
<!-- Keep this comment at the end of the file
122
119
Local variables:
123
120
mode: sgml
124
121