Doc #76471 [Ver->Csd]: PHP Warning: ftp_get() expects at least 4 parameters, 3 given
| From: | cmb@php.net | Date: | Wed, 13 Jun 2018 16:03:56 +0000 |
| Subject: | Doc #76471 [Ver->Csd]: PHP Warning: ftp_get() expects at least 4 parameters, 3 given | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-15765@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76471&edit=1
ID: 76471
Updated by: cmb@php.net
Reported by: peter279k at gmail dot com
Summary: PHP Warning: ftp_get() expects at least 4
parameters, 3 given
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: FTP related
Operating System: Ubuntu 16.04
PHP Version: 7.0.30
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2018-06-13 16:03:28] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=345129
Log: Fix #76471: PHP Warning: ftp_get() expects at least 4 parameters, 3 given
We add the missing changelog entries.
------------------------------------------------------------------------
[2018-06-13 15:07:17] nikic@php.net
The parameter is optional as of PHP 7.3. The docs need a changelog and maybe additional
clarification that the parameter is required in previous versions.
------------------------------------------------------------------------
[2018-06-13 15:04:25] peter279k at gmail dot com
Description:
------------
As title, when I try to use the ftp_get function to develop my project. I also got the error
message.
When I refer the PHP official doc, it seems that the ftp_get can accept the three parameters expect,
not 4. Is the official doc wrong?
PHP official doc: http://php.net/manual/en/function.ftp-get.php
Test script:
---------------
<?php
// define some variables
$local_file = 'local.zip';
$server_file = 'server.zip';
// set up basic connection
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// try to download $server_file and save to $local_file
if (ftp_get($conn_id, $local_file, $server_file)) {
echo "Successfully written to $local_file\n";
} else {
echo "There was a problem\n";
}
// close the connection
ftp_close($conn_id);
Expected result:
----------------
No error
Actual result:
--------------
PHP Warning: ftp_get() expects at least 4 parameters, 3 given
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76471&edit=1