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
Category
stdlibProblem
PHP 8.4 replaced ext/ftp connection resources with the
FTP\Connectionobject (ext/ftp/ftp.stub.php). #3353 tracks ftp_connect/login handlers, but the compiler must register theFTP\Connectioninternal class before handlers return Zend-compatible values (instanceof FTP\Connection, notresource).Verified 2026-06-07:
php-src reference
ext/ftp/ftp.stub.php—class Connectionin namespaceFTPext/ftp/php_ftp.c— connection object allocation,ftp_connectRepro (failure today)
FTP\Connectionclasstrue(final internal)bin/vm.phpfalseScope (this repo)
ext/ftp/BuiltinClasses.php(new)FTP\Connectioninternal classext/ftp/Module.phpftp_connect()returnsFTP\Connectionobjecttest/unit/FtpConnectionClassTest.phpPHP-in-PHP: connection object stores socket state in PHP; thin socket FFI only.
Done when
class_exists('FTP\\Connection')true on VMftp_connect()(when Stdlib: ext/ftp — ftp_connect/login/get/put (ext/ftp parity) #3353 lands) returnsFTP\Connection, not resourceget_debug_type($conn)isFTP\ConnectionVerification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter FtpConnectionClass'Related