Doc #69390 [Com]: ftp_chdir(null,'xxx') returns null
| From: | yk0242 at gmail dot com | Date: | Wed, 08 Apr 2015 03:08:40 +0000 |
| Subject: | Doc #69390 [Com]: ftp_chdir(null,'xxx') returns null | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-12118@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
Comment by: yk0242 at gmail dot com
Reported by: yk0242 at gmail dot com
Summary: ftp_chdir(null,'xxx') returns null
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:
I understand now that although the NULL return is not documented per function, it is documented in
the given page for internal functions in general.
Thank you for your clarification.
Previous Comments:
------------------------------------------------------------------------
[2015-04-07 13:10:29] cmb@php.net
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>
------------------------------------------------------------------------
[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