Doc #69390 [Opn->Nab]: ftp_chdir(null,'xxx') returns null

From: Date: Tue, 07 Apr 2015 13:10:30 +0000
Subject: Doc #69390 [Opn->Nab]: ftp_chdir(null,'xxx') returns null
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-12116@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69390&edit=1 ID: 69390 Updated by: cmb@php.net Reported by: yk0242 at gmail dot com Summary: ftp_chdir(null,'xxx') returns null -Status: Open +Status: Not a bug Type: Documentation Problem Package: Documentation problem Operating System: Windows 7 PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php That behavior is documented in the manual[1]: | If the parameters given to a function are not what it expects, | such as passing an array where a string is expected, the return | value of the function is undefined. In this case it will likely | return NULL but this is just a convention, and cannot be relied | upon. [1] <http://php.net/manual/en/functions.internal.php> Previous Comments: ------------------------------------------------------------------------ [2015-04-07 01:39:10] yk0242 at gmail dot com Description: ------------ --- From manual page: http://www.php.net/function.ftp-chdir --- The manual currently reads: Return Values Returns TRUE on success or FALSE on failure. However, if the resource $ftp_stream passed to ftp_chdir is null, the return value is neither TRUE or FALSE, but is null. Is this a behavioural problem, or should this be added to the documentation for clarity? (our version is currently PHP Version 5.2.17, and cannot update for a while from internal reasons...) Test script: --------------- var_dump(ftp_chdir(null,".")); //outputs null (and a PHP warning) Expected result: ---------------- boolean false Actual result: -------------- null ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69390&edit=1

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