#35306 [Bgs]: file_get_contents does not take 5 parameters as specified in PHP Manual

From: Date: Sun, 20 Nov 2005 21:09:42 +0000
Subject: #35306 [Bgs]: file_get_contents does not take 5 parameters as specified in PHP Manual
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969370957@lists.php.net to get a copy of this message
ID: 35306 User updated by: kpeters at monolithss dot com Reported By: kpeters at monolithss dot com Status: Bogus Bug Type: Documentation problem Operating System: SuSE Linux 9.3 PHP Version: Irrelevant New Comment: OK, I see that now. It's still a bit obscure, though. I suggest that a warning be added that on PHP < 5.1.0 only the three-parameter form is valid, and on PHP < 5.0.0 only the two-parameter form is valid. Previous Comments: ------------------------------------------------------------------------ [2005-11-20 21:34:31] derick@php.net Read that page fully and you see it is correct. ------------------------------------------------------------------------ [2005-11-20 21:31:31] kpeters at monolithss dot com Description: ------------ On both PHP 4.3.10 and PHP 5.0.3, when attempting to call file_get_contents with five parameters as specified in the manual (http://us3.php.net/manual/en/function.file-get-contents.php) I get the following errors: PHP 4.3.10: "Warning: file_get_contents() expects at most 2 parameters, 5 given" PHP 5.0.3: "PHP Warning: file_get_contents() expects at most 3 parameters, 5 given" Reproduce code: --------------- $file = file_get_contents($filename, null, null, $offset, $maxlength); Expected result: ---------------- I should get up to $maxlength bytes starting from $offset in $filename. Actual result: -------------- warning message as described above. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35306&edit=1

« previous php.doc (#969370957) next »