php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67154 ftp_nlist may return null value
Submitted: 2014-04-30 07:56 UTC Modified: 2014-04-30 08:39 UTC
From: Laurent dot Lyaudet at gmail dot com Assigned:
Status: Not a bug Package: FTP related
PHP Version: 5.4.27 OS: Debian wheezy
Private report: No CVE-ID: None
 [2014-04-30 07:56 UTC] Laurent dot Lyaudet at gmail dot com
Description:
------------
According to the documentation ftp_nlist should only return array or false value
but if parameters are incorrect it may return a null value (see test script).
I don't know if it may be useful in some situations. 
Hence I don't know if the code should be corrected or if the documentation should be completed.
Let me know if you think the problem is in the documentation. In that case, I'll modify it.

Best regards,
   Laurent Lyaudet

Test script:
---------------
<?php
var_dump(ftp_nlist(false, ''));
?>


Expected result:
----------------
false


Actual result:
--------------
null

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-30 08:39 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2014-04-30 08:39 UTC] requinix@php.net
Though not documented for each one individually, by convention the built-in functions will return null if you pass an incorrect type of parameter.

http://www.php.net/manual/en/functions.internal.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC