1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-24 07:42:10 +01:00

Fix incorrect return value description for yaml_parse_file() (#5106)

The manual stated that yaml_parse_file() returns false on failure.

In practice, the function returns either the parsed value (usually an array) or a string containing an error message, and does not return false.

This PR updates the return value documentation to reflect the actual behavior observed with ext-yaml on PHP 8.2 and 8.3.

Closes GH-4978
This commit is contained in:
Louis-Arnaud
2026-01-14 22:28:34 +01:00
committed by GitHub
parent aa120f36c5
commit 132d2a8d63

View File

@@ -68,12 +68,17 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the value encoded in <parameter>filename</parameter> in appropriate
PHP type&return.falseforfailure;. If <parameter>pos</parameter> is <literal>-1</literal> an
<type>array</type> will be returned with one entry for each document found
in the stream.
</para>
<simpara>
Returns the value encoded in <parameter>filename</parameter> in the appropriate
PHP type.
</simpara>
<simpara>
On failure, a string containing an error message is returned.
</simpara>
<simpara>
If <parameter>pos</parameter> is <literal>-1</literal>, an <type>array</type>
will be returned with one entry for each document found in the stream.
</simpara>
</refsect1>
<refsect1 role="notes">