|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #42524 file_get_contents() parameters in wrong order
Submitted: 2007-09-03 05:15 UTC Modified: 2007-09-03 06:26 UTC
From: i dot am dot inuyasha at gmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: i dot am dot inuyasha at gmail dot com
New email:
PHP Version: OS:


 [2007-09-03 05:15 UTC] i dot am dot inuyasha at gmail dot com
According to the manual:
file_get_contents() takes parameters string, resource, boolean, int, int in V5.2.4. PHP however is telling me parameter 3 should be a resource. The second and third parameters appear to be transposed.

Reproduce code:
$pa_news = file_get_contents($base_url . 'pa.txt', NULL, false, ftell($file), 0);

Expected result:
Contents of file read into $pa_news.

Actual result:
Warning message is displayed:
Warning: file_get_contents() expects parameter 3 to be resource, boolean given in F:\html\apache\index.php on line 46


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-03 06:26 UTC]
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.

 [2020-02-07 06:10 UTC]
Automatic comment on behalf of nicobn
Log: Fixed bug #42524
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Sep 24 18:01:24 2023 UTC