Skip to content

php-in-php: include_path stack compliance + BuiltinExecute on set/get (#3223) - #8006

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-include-path-3223
Jun 11, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/runtime-php-include-path-3223

Conversation

@PurHur

@PurHur PurHur commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

C runtime: 0 lines added/removed (phpc_progress.c unchanged — SIGSEGV ABI stub only).

php-src reference

  • ext/standard/basic_functions.c — get_include_path, set_include_path, restore_include_path
  • main/php_open_temporary_file.c — PG(include_path) stack

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter include_path'
OK (12 tests, 12 assertions)

Issue repro (VM):

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "
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\";
"'
get_include_path=yes
set_include_path=yes
restore_include_path=yes
include='found'

Closes #3223

Made with Cursor

…#3223)

Add include_path_stack PHPTs, fix file_include_path tests that used ?? (parser gap), and route get/set_include_path through BuiltinExecute so validation and stack updates run even when the return is discarded.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 6162e4f into master Jun 11, 2026
@PurHur
PurHur deleted the agent/runtime-php-include-path-3223 branch June 11, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: get_include_path() / set_include_path() / restore_include_path() — include path stack (bootstrap)

1 participant