|  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
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:
Solve the problem:
5 + 26 = ?
Subscribe to this entry?

 [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: Mon Oct 02 20:01:25 2023 UTC