xref: /PHP-7.4/ext/ftp/tests/bug39458.phpt (revision 1f655451)
1--TEST--
2Bug #39458 (ftp_nlist() returns false on empty directories)
3--SKIPIF--
4<?php
5require 'skipif.inc';
6?>
7--FILE--
8<?php
9require 'server.inc';
10
11$ftp = ftp_connect('127.0.0.1', $port);
12if (!$ftp) die("Couldn't connect to the server");
13
14var_dump(ftp_login($ftp, 'user', 'pass'));
15
16var_dump(ftp_nlist($ftp, ''));
17var_dump(ftp_nlist($ftp, 'emptydir'));
18var_dump(ftp_nlist($ftp, 'bogusdir'));
19
20ftp_close($ftp);
21?>
22--EXPECT--
23bool(true)
24array(3) {
25  [0]=>
26  string(5) "file1"
27  [1]=>
28  string(5) "file1"
29  [2]=>
30  string(9) "file
31b0rk"
32}
33array(0) {
34}
35bool(false)
36