php.net |  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
 [2007-09-03 05:15 UTC] i dot am dot inuyasha at gmail dot com
Description:
------------
According to the manual: http://ca3.php.net/manual/en/function.file-get-contents.php
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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


 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Feb 23 01:01:26 2019 UTC