<?php
foreach (['get_include_path', 'set_include_path', 'restore_include_path'] as $fn) {
echo $fn, '=', function_exists($fn) ? 'yes' : 'no', "\n";
}
$dir = sys_get_temp_dir() . '/phpc_inc_' . getmypid();
mkdir($dir);
file_put_contents($dir . '/only_here.php', '<?php return "found";');
$old = set_include_path($dir . PATH_SEPARATOR . get_include_path());
$r = include 'only_here.php';
restore_include_path();
@unlink($dir . '/only_here.php');
@rmdir($dir);
echo "include=", var_export($r, true), "\n";
Category
stdlib|bootstrapProblem
Zend maintains an include_path stack used by
include/requireandstream_resolve_include_path(). This compiler resolves literal includes via #475 / deploy root, but does not implement the standard functions to read or mutateinclude_path— breaking Composer-style bootstraps andphp.iniparity probes.Verified 2026-06-05:
function_exists('get_include_path')→ false onbin/vm.php;stream_resolve_include_path()also missing (#6051).php-src reference
ext/standard/basic_functions.c—PHP_FUNCTION(get_include_path),PHP_FUNCTION(set_include_path),PHP_FUNCTION(restore_include_path)main/php_open_temporary_file.c—PG(include_path)stackext/standard/streams.c—stream_resolve_include_path()(see Stdlib: stream_resolve_include_path() — include_path filename resolution missing (ext/standard/streams.c) #6051)Repro (failure today)
bin/vm.php(today)get_include_pathexistsyesno❌set_include_path+include 'only_here.php'include='found'restore_include_pathpops stackScope (PHP-in-PHP)
lib/VM/Context.phporRuntime— PATH_SEPARATOR-split stack, default.ext/standard/get_include_path.php,set_include_path.php,restore_include_path.phplib/VM.php/lib/Compiler.phpTYPE_INCLUDE— search stack after deploy rootext/standard/Module.phpstream_resolve_include_path()shares same stacktest/compliance/cases/stdlib/include_path_stack.phptphp script/bootstrap-inventory.php --checkafter wiringForbidden:
internal_*shims — wire real include resolution.Done when
include='found'on VMset_include_path()returns previous path string; nested calls stack correctlyrestore_include_path()pops one level; empty stack restores ini/default.PHPC_DEPLOY_ROOT/ AOT: PHPC_DEPLOY_ROOT for runtime template includes in deployed binaries #585./script/ci-fast.sh --filter include_pathgreenVerification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter include_path'Related