1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00
Files
archived-php-src/ext/ftp/tests/dead-resource.phpt
T
Ayesh Karunaratne 68224f2a41 Move FTP extension class FTPConnection to FTP\Connection
With the [namespaces in bundled extensions RFC](https://wiki.php.net/rfc/namespaces_in_bundled_extensions) passed, renaming the new `\FTPConnection` class to `\FTP\Connection`.
This also adds an entry to `./UPGRADING` file.

Related: #6925, #5945
2021-05-08 16:40:10 +02:00

25 lines
514 B
PHP

--TEST--
Attempt to use a closed FTP\Connection
--EXTENSIONS--
ftp
pcntl
--FILE--
<?php
require 'server.inc';
$ftp = ftp_connect('127.0.0.1', $port);
if (!$ftp) die("Couldn't connect to the server");
var_dump(ftp_login($ftp, 'user', 'pass'));
var_dump(ftp_close($ftp));
try {
var_dump(ftp_login($ftp, 'user', 'pass'));
echo "Login did not throw\n";
} catch (ValueError $ex) {
echo "Exception: ", $ex->getMessage(), "\n";
}
--EXPECT--
bool(true)
bool(true)
Exception: FTP\Connection is already closed