ftp_close

Supported Versions: PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8
Closes an FTP connection
Alias ftp_quit
<?php ftp_close(FTP\Connection $ftp): bool
<?php     public function __destruct()

    {

        if (is_resource($this->connection)) {

            @ftp_close($this->connection);

        }

        $this->connection = false;

    }
<?php             $this->ignorePassiveAddress($options, $connection);

            $this->makeConnectionPassive($options, $connection);

        } catch (FtpConnectionException $exception) {

            ftp_close($connection);

            throw $exception;

        }
<?php         $this->runScenario(function () use ($options) {

            $connection = $this->connectionProvider->createConnection($options);

            $this->assertIsResource($connection);

            $this->assertTrue(ftp_close($connection));

        });

    }
<?php         $this->runScenario(function () use ($options) {

            $connection = (new FtpConnectionProvider())->createConnection($options);

            ftp_close($connection);



            $connected = (new NoopCommandConnectivityChecker())->isConnected($connection);
<?php             $connection = $provider->createConnection($options);

            $connectedChecker = new RawListFtpConnectivityChecker();

            $this->assertTrue($connectedChecker->isConnected($connection));

            @ftp_close($connection);

            $this->assertFalse($connectedChecker->isConnected($connection));

        });

    }