reference/filesystem/functions/fopen.xml
74b2af242f2131cd43a8830fee3864f1f68ccbed
74b2af242f2131cd43a8830fee3864f1f68ccbed
...
...
@@ -9,11 +9,11 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>resource</type><methodname>fopen</methodname>
12
+
<type class="union"><type>resource</type><type>false</type></type><methodname>fopen</methodname>
13
13
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
14
14
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
15
15
<methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter><initializer>&false;</initializer></methodparam>
16
-
<methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam>
16
+
<methodparam choice="opt"><type class="union"><type>resource</type><type>null</type></type><parameter>context</parameter><initializer>&null;</initializer></methodparam>
17
17
</methodsynopsis>
18
18
<para>
19
19
<function>fopen</function> binds a named resource, specified by
...
...
@@ -51,7 +51,7 @@
51
51
network URL, PHP will check to make sure that
52
52
<link linkend="ini.allow-url-fopen">allow_url_fopen</link> is
53
53
enabled. If it is switched off, PHP will emit a warning and
54
-
the fopen call will fail.
54
+
the <function>fopen</function> call will fail.
55
55
</para>
56
56
<note>
57
57
<para>
...
...
@@ -123,9 +123,8 @@ $handle = fopen("c:\\folder\\resource.txt", "r");
123
123
<row>
124
124
<entry><literal>'w+'</literal></entry>
125
125
<entry>
126
-
Open for reading and writing; place the file pointer at
127
-
the beginning of the file and truncate the file to zero
128
-
length. If the file does not exist, attempt to create it.
126
+
Open for reading and writing; otherwise it has the
127
+
same behavior as <literal>'w'</literal>.
129
128
</entry>
130
129
</row>
131
130
<row>
...
...
@@ -244,6 +243,14 @@ $handle = fopen("c:\\folder\\resource.txt", "r");
244
243
<literal>'b'</literal> mode instead.
245
244
</para>
246
245
</note>
246
+
<note>
247
+
<simpara>
248
+
The <parameter>mode</parameter> is ignored for <filename>php://output</filename>,
249
+
<filename>php://input</filename>, <filename>php://stdin</filename>,
250
+
<filename>php://stdout</filename>, <filename>php://stderr</filename> and
251
+
<filename>php://fd</filename> stream wrappers.
252
+
</simpara>
253
+
</note>
247
254
</listitem>
248
255
</varlistentry>
249
256
<varlistentry>
...
...
@@ -251,7 +258,7 @@ $handle = fopen("c:\\folder\\resource.txt", "r");
251
258
<listitem>
252
259
<para>
253
260
The optional third <parameter>use_include_path</parameter> parameter
254
-
can be set to '1' or &true; if you want to search for the file in the
261
+
can be set to &true; if you want to search for the file in the
255
262
<link linkend="ini.include-path">include_path</link>, too.
256
263
</para>
257
264
</listitem>
258
265