#42524 [NEW]: file_get_contents() parameters in wrong order
| From: | i dot am dot inuyasha at gmail dot com | Date: | Mon, 03 Sep 2007 05:15:00 +0000 |
| Subject: | #42524 [NEW]: file_get_contents() parameters in wrong order | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969377993@lists.php.net to get a copy of this message | ||
From: i dot am dot inuyasha at gmail dot com
Operating system: Windows XP
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: file_get_contents() parameters in wrong order
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
--
Edit bug report at http://bugs.php.net/?id=42524&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42524&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42524&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42524&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42524&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=42524&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=42524&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=42524&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=42524&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=42524&r=support
Expected behavior: http://bugs.php.net/fix.php?id=42524&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=42524&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=42524&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42524&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42524&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42524&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=42524&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=42524&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=42524&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=42524&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=42524&r=mysqlcfg