xref: /PHP-8.1/ext/ftp/tests/bug39458-2.phpt (revision e9f783fc)
1--TEST--
2Bug #39458 (ftp_nlist() returns false on empty directories (other server behaviour))
3--EXTENSIONS--
4ftp
5pcntl
6--FILE--
7<?php
8$bug39458=1;
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