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

Pull Requests

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.


 [2020-02-07 06:10 UTC] phpdocbot@php.net
Automatic comment on behalf of nicobn
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=d7918a5fedbf2e0be88fd65884ae93c16ab9da14
Log: Fixed bug #42524
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC