@@ -235,7 +235,7 @@ function fflush($stream): void
235235 * @param resource $stream A valid file pointer to a file successfully opened by
236236 * fopen, popen, or
237237 * fsockopen.
238- * @param int $length Must be greater than the longest line (in characters) to be found in
238+ * @param \0| int $length Must be greater than the longest line (in characters) to be found in
239239 * the CSV file (allowing for trailing line-end characters). Otherwise the
240240 * line is split in chunks of length characters,
241241 * unless the split would occur inside an enclosure.
@@ -251,7 +251,7 @@ function fflush($stream): void
251251 * @throws FilesystemException
252252 *
253253 */
254- function fgetcsv ($ stream , int $ length = null , string $ separator = ", " , string $ enclosure = "\"" , string $ escape = "\\" )
254+ function fgetcsv ($ stream , $ length = null , string $ separator = ", " , string $ enclosure = "\"" , string $ escape = "\\" )
255255{
256256 error_clear_last ();
257257 if ($ escape !== "\\" ) {
@@ -299,14 +299,14 @@ function fgetcsv($stream, int $length = null, string $separator = ",", string $e
299299 * Seeking (offset) is not supported with remote files.
300300 * Attempting to seek on non-local files may work with small offsets, but this
301301 * is unpredictable because it works on the buffered stream.
302- * @param int $length Maximum length of data read. The default is to read until end
302+ * @param \0| int $length Maximum length of data read. The default is to read until end
303303 * of file is reached. Note that this parameter is applied to the
304304 * stream processed by the filters.
305305 * @return string The function returns the read data.
306306 * @throws FilesystemException
307307 *
308308 */
309- function file_get_contents (string $ filename , bool $ use_include_path = false , $ context = null , int $ offset = 0 , int $ length = null ): string
309+ function file_get_contents (string $ filename , bool $ use_include_path = false , $ context = null , int $ offset = 0 , $ length = null ): string
310310{
311311 error_clear_last ();
312312 if ($ length !== null ) {
@@ -395,11 +395,11 @@ function file_get_contents(string $filename, bool $use_include_path = false, $co
395395 *
396396 * @param resource|null $context A valid context resource created with
397397 * stream_context_create.
398- * @return int This function returns the number of bytes that were written to the file.
398+ * @return \0| int This function returns the number of bytes that were written to the file.
399399 * @throws FilesystemException
400400 *
401401 */
402- function file_put_contents (string $ filename , $ data , int $ flags = 0 , $ context = null ): int
402+ function file_put_contents (string $ filename , $ data , int $ flags = 0 , $ context = null )
403403{
404404 error_clear_last ();
405405 if ($ context !== null ) {
@@ -613,12 +613,12 @@ function fileperms(string $filename): int
613613 * Gets the size for the given file.
614614 *
615615 * @param string $filename Path to the file.
616- * @return int Returns the size of the file in bytes, or FALSE (and generates an error
616+ * @return \0| int Returns the size of the file in bytes, or FALSE (and generates an error
617617 * of level E_WARNING) in case of an error.
618618 * @throws FilesystemException
619619 *
620620 */
621- function filesize (string $ filename ): int
621+ function filesize (string $ filename )
622622{
623623 error_clear_last ();
624624 $ result = \filesize ($ filename );
@@ -874,7 +874,7 @@ function flock($stream, int $operation, ?int &$would_block = null): void
874874 * @param bool $use_include_path The optional third use_include_path parameter
875875 * can be set to '1' or TRUE if you want to search for the file in the
876876 * include_path, too.
877- * @param resource $context A context stream
877+ * @param resource|null $context A context stream
878878 * resource.
879879 * @return resource Returns a file pointer resource on success
880880 * @throws FilesystemException
@@ -929,12 +929,12 @@ function fopen(string $filename, string $mode, bool $use_include_path = false, $
929929 *
930930 * @param resource $stream A file system pointer resource
931931 * that is typically created using fopen.
932- * @param int $length Up to length number of bytes read.
932+ * @param \0| int $length Up to length number of bytes read.
933933 * @return string Returns the read string.
934934 * @throws FilesystemException
935935 *
936936 */
937- function fread ($ stream , int $ length ): string
937+ function fread ($ stream , $ length ): string
938938{
939939 error_clear_last ();
940940 $ result = \fread ($ stream , $ length );
@@ -998,7 +998,7 @@ function fsync($stream): void
998998 * @param resource $stream The file pointer.
999999 *
10001000 * The stream must be open for writing.
1001- * @param int $size The size to truncate to.
1001+ * @param \0| int $size The size to truncate to.
10021002 *
10031003 * If size is larger than the file then the file
10041004 * is extended with null bytes.
@@ -1008,7 +1008,7 @@ function fsync($stream): void
10081008 * @throws FilesystemException
10091009 *
10101010 */
1011- function ftruncate ($ stream , int $ size ): void
1011+ function ftruncate ($ stream , $ size ): void
10121012{
10131013 error_clear_last ();
10141014 $ result = \ftruncate ($ stream , $ size );
@@ -1024,14 +1024,14 @@ function ftruncate($stream, int $size): void
10241024 * @param resource $stream A file system pointer resource
10251025 * that is typically created using fopen.
10261026 * @param string $data The string that is to be written.
1027- * @param int $length If length is an integer, writing will stop
1027+ * @param \0| int $length If length is an integer, writing will stop
10281028 * after length bytes have been written or the
10291029 * end of data is reached, whichever comes first.
1030- * @return int
1030+ * @return \0| int
10311031 * @throws FilesystemException
10321032 *
10331033 */
1034- function fwrite ($ stream , string $ data , int $ length = null ): int
1034+ function fwrite ($ stream , string $ data , $ length = null )
10351035{
10361036 error_clear_last ();
10371037 if ($ length !== null ) {
@@ -1356,11 +1356,11 @@ function parse_ini_string(string $ini_string, bool $process_sections = false, in
13561356 * you want to search for the file in the include_path, too.
13571357 * @param resource $context A context stream
13581358 * resource.
1359- * @return int Returns the number of bytes read from the file on success
1359+ * @return \0| int Returns the number of bytes read from the file on success
13601360 * @throws FilesystemException
13611361 *
13621362 */
1363- function readfile (string $ filename , bool $ use_include_path = false , $ context = null ): int
1363+ function readfile (string $ filename , bool $ use_include_path = false , $ context = null )
13641364{
13651365 error_clear_last ();
13661366 if ($ context !== null ) {
0 commit comments