Category
php-in-php · JIT/AOT lowering migration
Problem
VM get_include_path() / set_include_path() / restore_include_path() / stream_resolve_include_path() use PHP builtins in ext/standard/ + lib/Web/IncludePathResolver.php.
JIT/AOT duplicates include-path stack semantics in lib/JIT/Builtin/IncludePathRuntime.php and lib/JIT/Builtin/Type.php (__compiler_get_include_path, __compiler_set_include_path, __compiler_restore_include_path, __compiler_stream_resolve_include_path, phpc_include_path_* LLVM globals).
This diverges from VM behavior and blocks shrinking the C/LLVM runtime per #1492.
php-src reference (semantics)
Repro
<?php
$old = get_include_path();
set_include_path($old . PATH_SEPARATOR . '/tmp');
var_export(str_contains(get_include_path(), '/tmp'));
echo "\n";
restore_include_path();
var_export(get_include_path() === $old);
echo "\n";
var_export(stream_resolve_include_path('compile_driver.php') !== false);
echo "\n";
php bin/vm.php repro_include_path.php
php bin/jit.php repro_include_path.php
| Engine |
Expected |
| Zend |
true, true, bool per CWD |
| VM |
matches Zend |
| JIT today |
may diverge — uses IncludePathRuntime LLVM stack |
Scope
| Layer |
Path |
| Shrink |
lib/JIT/Builtin/IncludePathRuntime.php — delete LLVM stack impl |
| JIT |
Route through JitResolveIncludePath / builtin jit() on ext/standard/*include_path*.php |
| Shared |
lib/Web/IncludePathResolver.php — single SSOT for VM+JIT |
| AOT |
link PHP helpers, not phpc_include_path_* globals |
Done when
Related
Category
php-in-php· JIT/AOT lowering migrationProblem
VM
get_include_path()/set_include_path()/restore_include_path()/stream_resolve_include_path()use PHP builtins inext/standard/+lib/Web/IncludePathResolver.php.JIT/AOT duplicates include-path stack semantics in
lib/JIT/Builtin/IncludePathRuntime.phpandlib/JIT/Builtin/Type.php(__compiler_get_include_path,__compiler_set_include_path,__compiler_restore_include_path,__compiler_stream_resolve_include_path,phpc_include_path_*LLVM globals).This diverges from VM behavior and blocks shrinking the C/LLVM runtime per #1492.
php-src reference (semantics)
ext/standard/basic_functions.c—php_set_include_path()/php_get_include_path()ext/standard/streams.c—php_stream_resolve_include_path()ext/standard/get_include_path.php,set_include_path.php,restore_include_path.php,stream_resolve_include_path.php,lib/Web/IncludePathResolver.phpRepro
true,true, bool per CWDScope
lib/JIT/Builtin/IncludePathRuntime.php— delete LLVM stack implJitResolveIncludePath/ builtinjit()onext/standard/*include_path*.phplib/Web/IncludePathResolver.php— single SSOT for VM+JITphpc_include_path_*globalsDone when
stream_resolve_include_path()JIT uses same resolver as VMIncludePathRuntime.php/Type.phpLLVM registrations./script/ci-fast.sh --filter include_pathgreen (or add compliance guard)Related