|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #78653 Documentation for ftp-put contains incorrect default
Submitted: 2019-10-09 07:13 UTC Modified: 2019-10-20 10:43 UTC
From: valeri dot geiser at km-logistik-service dot de Assigned: cmb (profile)
Status: Closed Package: FTP related
PHP Version: 7.3.10 OS: -
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: valeri dot geiser at km-logistik-service dot de
New email:
PHP Version: OS:


 [2019-10-09 07:13 UTC] valeri dot geiser at km-logistik-service dot de
From manual page:
The function signature - according to above mentioned documentation page - is:
ftp_put ( resource $ftp_stream , string $remote_file , string $local_file [, int $mode = FTP_IMAGE [, int $startpos = 0 ]] ) : bool

But the parameter doc says
    The transfer mode. Must be either FTP_ASCII or FTP_BINARY.

So I assume the default for $mode has to be either FTP_ASCII OR FTP_BINARY and not FTP_IMAGE. Since it is FTP_BINARY for ftp_get, I assume it is FTP_BINARY here as well.

Test script:


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-10-09 07:25 UTC]
-Package: Documentation problem +Package: FTP related
 [2019-10-09 07:25 UTC]
As mentioned on the Predefined Constants page, FTP_IMAGE is an alias of FTP_BINARY.
 [2019-10-09 07:30 UTC] valeri dot geiser at km-logistik-service dot de
That is correct, however, it is not user-friendly and also inconsistent (at least inside that very page). After all, it confuses that inside one page of documentation, different constants are used.
Following your argumentation, it would also be possible to document it with the default 2, since this is also the same. But does it really help? Shouldn't a documentation be clear and simple? Is it really a good thing that one needs to look at a separate documentation page (predefined constant) to resolve this inconsistency?
 [2019-10-09 07:33 UTC]
According to the implementation, however, FTP_BINARY is an alias
of FTP_IMAGE[1], not the other way round.

[1] <>
 [2019-10-13 15:04 UTC]
The following pull request has been associated:

Patch Name: Change FTP_IMAGE to FTP_BINARY
On GitHub:
 [2019-10-20 10:43 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2019-10-20 10:43 UTC]
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-2021 The PHP Group
All rights reserved.
Last updated: Sun Apr 18 05:01:24 2021 UTC