Category
stdlib · jit · php-src-strict
Problem
Several ext/posix helpers are implemented for VM but hard-stubbed for JIT/AOT builds. In-tree examples:
This creates surprising VM vs JIT divergence and blocks CLI tooling compiled under bin/jit.php / AOT.
php-src reference
Repro
cat > /tmp/repro_posix_jit.php <<'PHP'
<?php
foreach (['posix_times', 'posix_setsid', 'posix_getrlimit'] as $fn) {
echo $fn, ' exists=', var_export(function_exists($fn), true), "\n";
if (function_exists($fn)) {
try { var_dump($fn()); } catch (Throwable $e) { echo ' ', get_class($e), ': ', $e->getMessage(), "\n"; }
}
}
PHP
./script/docker-exec.sh -- bash -lc 'php /tmp/repro_posix_jit.php; php bin/vm.php /tmp/repro_posix_jit.php; php bin/jit.php /tmp/repro_posix_jit.php'
| Backend |
posix_times() |
| Zend PHP |
array of ticks (or false + warning if unsupported) |
bin/vm.php |
array (platform-dependent) |
bin/jit.php (today) |
fatal Error from JIT stub |
Expected (Zend)
Returns structured arrays / ints per stub; warnings + false when the host cannot satisfy the call — never a compile-time stub Error.
Scope (PHP-in-PHP)
| Layer |
Path |
| Policy |
decide VM-fallback vs native JIT lowering per function |
| PHP SSOT |
reuse ext/posix/VmPosix*.php helpers where they exist |
| JIT |
add lowering in ext/posix/JitPosix.php or mark VM-only in capability matrix with explicit runtime fallback |
| Tests |
test/compliance/cases/ext/posix_times_jit.phpt (skip when host lacks POSIX) |
Prefer PHP implementations + thin FFI; avoid new runtime/*.c tables.
Done when (php-src-strict)
Related
Category
stdlib·jit· php-src-strictProblem
Several ext/posix helpers are implemented for VM but hard-stubbed for JIT/AOT builds. In-tree examples:
ext/posix/posix_times.php→ throwsError: posix_times() is not implemented for JIT …ext/posix/posix_setsid.php→ throwsError: posix_setsid() is not implemented for JIT …ext/posix/posix_getrlimit.php/posix_setrlimit.php— same pattern (Stdlib: posix_times()/posix_getrlimit()/posix_setrlimit()/posix_setsid() — ext/posix timing & session helpers (phase 2 of #3339) #7173)This creates surprising VM vs JIT divergence and blocks CLI tooling compiled under
bin/jit.php/ AOT.php-src reference
ext/posix/posix.c—PHP_FUNCTION(posix_times),posix_setsid,posix_getrlimit,posix_setrlimit, …ext/posix/posix.stub.php— signatures + return shapesRepro
posix_times()arrayof ticks (orfalse+ warning if unsupported)bin/vm.phpbin/jit.php(today)Errorfrom JIT stubExpected (Zend)
Returns structured arrays / ints per stub; warnings +
falsewhen the host cannot satisfy the call — never a compile-time stubError.Scope (PHP-in-PHP)
ext/posix/VmPosix*.phphelpers where they existext/posix/JitPosix.phpor mark VM-only in capability matrix with explicit runtime fallbacktest/compliance/cases/ext/posix_times_jit.phpt(skip when host lacks POSIX)Prefer PHP implementations + thin FFI; avoid new
runtime/*.ctables.Done when (php-src-strict)
php bin/jit.php /tmp/repro_posix_jit.phpno longer fatals on supported platformsdocs/capabilities.mdregenerated — JIT column matches realityfalse, notLogicExceptionstubsRelated