[doc-en] master: filesystem: document the ValueError of fgets(), file_get_contents(), and touch() (#6167)

From: Date: Sat, 28 Nov 2026 08:27:28 +0000
Subject: [doc-en] master: filesystem: document the ValueError of fgets(), file_get_contents(), and touch() (#6167)
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-24031@lists.php.net to get a copy of this message
Author: Alejandro Borrego (abp002) Committer: GitHub (web-flow) Pusher: lacatoire Date: 2026-11-28T09:27:24+01:00 Commit: https://github.com/php/doc-en/commit/ec36b0c0e950e975eb32a86bf4dfbc658a553e71 Raw diff: https://github.com/php/doc-en/commit/ec36b0c0e950e975eb32a86bf4dfbc658a553e71.diff filesystem: document the ValueError of fgets(), file_get_contents(), and touch() (#6167) Co-authored-by: Alejandro Borrego <210245044+abp002@users.noreply.github.com> Changed paths: M reference/filesystem/functions/fgets.xml M reference/filesystem/functions/file-get-contents.xml M reference/filesystem/functions/touch.xml Diff: diff --git a/reference/filesystem/functions/fgets.xml b/reference/filesystem/functions/fgets.xml index 8d985d97f14a..877d24faa93b 100644 --- a/reference/filesystem/functions/fgets.xml +++ b/reference/filesystem/functions/fgets.xml @@ -55,6 +55,38 @@ </para> </refsect1> + <refsect1 role="errors"> + &reftitle.errors; + <simpara> + Throws a <exceptionname>ValueError</exceptionname> if + <parameter>length</parameter> is less than <literal>1</literal>. + </simpara> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>8.0.0</entry> + <entry> + Now throws a <exceptionname>ValueError</exceptionname> if + <parameter>length</parameter> is less than <literal>1</literal>. + Previously, an <constant>E_WARNING</constant> was raised and &false; was returned. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </refsect1> + <refsect1 role="examples"> &reftitle.examples; <para> diff --git a/reference/filesystem/functions/file-get-contents.xml b/reference/filesystem/functions/file-get-contents.xml index 624b1a3e8bde..f6d3fb55767a 100644 --- a/reference/filesystem/functions/file-get-contents.xml +++ b/reference/filesystem/functions/file-get-contents.xml @@ -112,10 +112,15 @@ <refsect1 role="errors"> &reftitle.errors; - <para> - An <constant>E_WARNING</constant> level error is generated if <parameter>filename</parameter> cannot be found, <parameter>length</parameter> - is less than zero, or if seeking to the specified <parameter>offset</parameter> in the stream fails. - </para> + <simpara> + Throws a <exceptionname>ValueError</exceptionname> if + <parameter>length</parameter> is less than <literal>0</literal>. + </simpara> + <simpara> + An <constant>E_WARNING</constant> level error is generated if + <parameter>filename</parameter> cannot be found, or if seeking to the + specified <parameter>offset</parameter> in the stream fails. + </simpara> <para> When <function>file_get_contents</function> is called on a directory, an <constant>E_WARNING</constant> level error is generated on Windows, @@ -135,6 +140,14 @@ </row> </thead> <tbody> + <row> + <entry>8.0.0</entry> + <entry> + Now throws a <exceptionname>ValueError</exceptionname> if + <parameter>length</parameter> is less than <literal>0</literal>. + Previously, an <constant>E_WARNING</constant> was raised and &false; was returned. + </entry> + </row> <row> <entry>8.0.0</entry> <entry> diff --git a/reference/filesystem/functions/touch.xml b/reference/filesystem/functions/touch.xml index eebaf7c8d8a6..8f90ff85c8aa 100644 --- a/reference/filesystem/functions/touch.xml +++ b/reference/filesystem/functions/touch.xml @@ -69,6 +69,15 @@ </para> </refsect1> + <refsect1 role="errors"> + &reftitle.errors; + <simpara> + Throws a <exceptionname>ValueError</exceptionname> if + <parameter>mtime</parameter> is &null; and <parameter>atime</parameter> + is not &null;. + </simpara> + </refsect1> + <refsect1 role="changelog"> &reftitle.changelog; <informaltable> @@ -80,6 +89,14 @@ </row> </thead> <tbody> + <row> + <entry>8.0.0</entry> + <entry> + Now throws a <exceptionname>ValueError</exceptionname> if + <parameter>mtime</parameter> is &null; and <parameter>atime</parameter> + is not &null;. + </entry> + </row> <row> <entry>8.0.0</entry> <entry>

« previous php.doc.cvs (#24031) next »