1
0
mirror of https://github.com/php/php-src.git synced 2026-04-17 04:51:03 +02:00
Files
archived-php-src/ext/ftp/tests/ftp_constructor.phpt
Ayesh Karunaratne 012439b78e FTP: Disallow direct FTPConnection construction
Similar to other resource to object migrations, `FTPConnection` class is not allowed to be constructed with `new FTPConnection`.
Related to b4503fbf88.

Closes GH-6533.
2020-12-23 09:54:38 +01:00

16 lines
327 B
PHP

--TEST--
Attempt to instantiate an FTPConnection directly
--SKIPIF--
<?php
require 'skipif.inc';
--FILE--
<?php
try {
new FTPConnection();
} catch (Error $ex) {
echo "Exception: ", $ex->getMessage(), "\n";
}
--EXPECT--
Exception: Cannot directly construct FTPConnection, use ftp_connect() or ftp_ssl_connect() instead