Doc #78653 [Opn]: Documentation for ftp-put contains incorrect default

From: Date: Wed, 09 Oct 2019 07:30:34 +0000
Subject: Doc #78653 [Opn]: Documentation for ftp-put contains incorrect default
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-16994@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78653&edit=1 ID: 78653 User updated by: valeri dot geiser at km-logistik-service dot de Reported by: valeri dot geiser at km-logistik-service dot de Summary: Documentation for ftp-put contains incorrect default Status: Open Type: Documentation Problem Package: FTP related Operating System: - PHP Version: 7.3.10 Block user comment: N Private report: N New Comment: 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? Previous Comments: ------------------------------------------------------------------------ [2019-10-09 07:25:36] requinix@php.net As mentioned on the Predefined Constants page, FTP_IMAGE is an alias of FTP_BINARY. ------------------------------------------------------------------------ [2019-10-09 07:13:42] valeri dot geiser at km-logistik-service dot de Description: ------------ --- From manual page: https://php.net/function.ftp-put --- 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 mode 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: --------------- N/A ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78653&edit=1

« previous php.doc.bugs (#16994) next »