Skip to content

Stdlib: FTP\\Connection object — PHP 8.4 ext/ftp resource→object missing (ftp.stub.php, pairs #3353) #7270

Description

@PurHur

Category

stdlib

Problem

PHP 8.4 replaced ext/ftp connection resources with the FTP\Connection object (ext/ftp/ftp.stub.php). #3353 tracks ftp_connect/login handlers, but the compiler must register the FTP\Connection internal class before handlers return Zend-compatible values (instanceof FTP\Connection, not resource).

Verified 2026-06-07:

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php -r "
echo class_exists(\"FTP\\\\Connection\", false) ? \"yes\" : \"no\", PHP_EOL;
echo function_exists(\"ftp_connect\") ? \"yes\" : \"no\", PHP_EOL;
"'
# no / no

php-src reference

Repro (failure today)

<?php
var_export(class_exists('FTP\\Connection', false));
echo "\n";
Runtime FTP\Connection class
Zend PHP 8.4+ true (final internal)
bin/vm.php false

Scope (this repo)

Path Work
ext/ftp/BuiltinClasses.php (new) Register FTP\Connection internal class
ext/ftp/Module.php Module skeleton (phase 0) even before libc handlers
#3353 ftp_connect() returns FTP\Connection object
Tests test/unit/FtpConnectionClassTest.php

PHP-in-PHP: connection object stores socket state in PHP; thin socket FFI only.

Done when

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter FtpConnectionClass'

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machineenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web apps

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions