Category
stdlib + JIT — php-src-strict
Problem
spl_autoload(), spl_autoload_functions(), and spl_autoload_extensions() are registered on VM but JIT/AOT throw LogicException (“not implemented for JIT”). Web apps and Composer-style autoloaders that run under bin/jit.php or AOT binaries cannot register or list autoload callbacks.
VM already stores callbacks via VmSplAutoload; JIT must read/write the same list without a parallel LLVM autoload table.
php-src reference
Repro
test/repro/maintainer_spl_autoload_jit.php:
<?php
spl_autoload_register(function (string $c): void {
echo "autoload:$c\n";
});
try {
new DoesNotExist();
} catch (Throwable $e) {
// expected
}
var_dump(is_array(spl_autoload_functions()));
# Zend reference
php test/repro/maintainer_spl_autoload_jit.php
# VM (works today)
./script/docker-exec.sh -- php bin/vm.php test/repro/maintainer_spl_autoload_jit.php
# JIT (fails today — target of this issue)
./script/docker-exec.sh -- php bin/jit.php test/repro/maintainer_spl_autoload_jit.php
Zend / VM: prints autoload:DoesNotExist and bool(true) for spl_autoload_functions().
JIT today: spl_autoload_register() is not implemented for JIT in this compiler build (#4256) (same family for spl_autoload / spl_autoload_extensions).
Scope (this repo)
| Path |
Work |
ext/standard/spl_autoload*.php |
VM handlers (existing) |
ext/standard/VmSplAutoload.php |
SSOT callback list |
lib/JIT/Builtin/JitSplAutoload.php |
Implement JIT lowering (no new runtime/*.c) |
| Tests |
test/compliance/cases/stdlib/spl_autoload_jit.phpt |
Done when (php-src-strict)
Related
Category
stdlib+ JIT — php-src-strictProblem
spl_autoload(),spl_autoload_functions(), andspl_autoload_extensions()are registered on VM but JIT/AOT throwLogicException(“not implemented for JIT”). Web apps and Composer-style autoloaders that run underbin/jit.phpor AOT binaries cannot register or list autoload callbacks.VM already stores callbacks via
VmSplAutoload; JIT must read/write the same list without a parallel LLVM autoload table.php-src reference
ext/spl/php_spl.c— autoload stackext/spl/spl_functions.c—spl_autoload,spl_autoload_functions,spl_autoload_extensionsext/spl/spl_functions.stub.php— arginfoRepro
test/repro/maintainer_spl_autoload_jit.php:Zend / VM: prints
autoload:DoesNotExistandbool(true)forspl_autoload_functions().JIT today:
spl_autoload_register() is not implemented for JIT in this compiler build (#4256)(same family forspl_autoload/spl_autoload_extensions).Scope (this repo)
ext/standard/spl_autoload*.phpext/standard/VmSplAutoload.phplib/JIT/Builtin/JitSplAutoload.phpruntime/*.c)test/compliance/cases/stdlib/spl_autoload_jit.phptDone when (php-src-strict)
bin/jit.phpand AOT when in scopespl_autoload_register()default handler, prepend flag, andspl_autoload_functions()ordering match Zendspl_autoload_extensions()getter/setter parity./script/ci-local.sh --filter spl_autoloadgreenRelated