[doc-en] master: Fix incorrect return value description for yaml_parse_file() (#5106)
| From: | Louis-Arnaud via GitHub | Date: | Wed, 14 Jan 2026 21:28:36 +0000 |
| Subject: | [doc-en] master: Fix incorrect return value description for yaml_parse_file() (#5106) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-22950@lists.php.net to get a copy of this message | ||
Author: Louis-Arnaud (lacatoire)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2026-01-14T21:28:34Z
Commit: https://github.com/php/doc-en/commit/132d2a8d63f971351f5c82046495ad78443bc46a
Raw diff: https://github.com/php/doc-en/commit/132d2a8d63f971351f5c82046495ad78443bc46a.diff
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
Changed paths:
M reference/yaml/functions/yaml-parse-file.xml
Diff:
diff --git a/reference/yaml/functions/yaml-parse-file.xml
b/reference/yaml/functions/yaml-parse-file.xml
index dc8d9e413f69..a4897ac8edd7 100644
--- a/reference/yaml/functions/yaml-parse-file.xml
+++ b/reference/yaml/functions/yaml-parse-file.xml
@@ -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">