php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #81018 file_get_contents('file.txt', maxlen: 123);
Submitted: 2021-05-07 05:12 UTC Modified: 2021-05-07 14:02 UTC
From: saymongcsw at gmail dot com Assigned: sergey (profile)
Status: Closed Package: Documentation problem
PHP Version: 8.0.5 OS: N/A
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
6 + 22 = ?
Subscribe to this entry?

 
 [2021-05-07 05:12 UTC] saymongcsw at gmail dot com
Description:
------------
file_get_contents ( string $filename , bool $use_include_path = false , resource $context = ? , int $offset = 0 , int $maxlen = ? ) : string|false

Source: https://www.php.net/manual/en/function.file-get-contents.php
`$maxlen` is actually `$length`.

Test script:
---------------
<?php

try {
    file_get_contents('php://input', length: 2000);
    file_get_contents('php://input', maxlen: 2000);
} catch (Error $e) {
    echo $e->getMessage();
}

Actual result:
--------------
Unknown named parameter $maxlen

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-05-07 14:02 UTC] sergey@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: sergey
 [2021-05-07 14:02 UTC] sergey@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

Applied with commit https://github.com/php/doc-en/commit/6a7a96ccc689ed202b81964f38d2360962cd70b2
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 13:01:28 2024 UTC