Skip to content

Stdlib: stream_resolve_include_path() + include_path stack (#6051) - #7690

Merged
PurHur merged 1 commit into
masterfrom
agent/stdlib-stream-resolve-include-path-6051
Jun 8, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/stdlib-stream-resolve-include-path-6051

Conversation

@PurHur

@PurHur PurHur commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implements stream_resolve_include_path(), get_include_path(), set_include_path(), and restore_include_path() in PHP (ext/standard/) with php-src reference ext/standard/streams.c / basic_functions.c.
  • Adds VmIncludePath stack + VmFs::resolveIncludePath() shared by VmMetaTags (no more undefined builtin call) and lib/VM.php include resolution.
  • JIT/AOT LLVM lowering via IncludePathRuntime (__compiler_stream_resolve_include_path, include_path globals).

Closes #6051

php-src reference

  • ext/standard/streams.c — PHP_FUNCTION(stream_resolve_include_path)
  • ext/standard/basic_functions.c — get_include_path / set_include_path / restore_include_path

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit test/unit/StreamResolveIncludePathTest.php
vendor/bin/phpunit --filter stream_resolve_include_path
'

Output:

OK (3 tests, 7 assertions)   # StreamResolveIncludePathTest
OK (4 tests, 4 assertions)   # VM + JIT compliance PHPTs

Repro:

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "echo function_exists(\"stream_resolve_include_path\") ? \"yes\" : \"no\", PHP_EOL;"
'
# yes

Notes

Made with Cursor

Implement PHP-in-PHP include_path lookup per ext/standard/streams.c:
VmIncludePath stack, get/set/restore_include_path, stream_resolve_include_path
with VM + JIT/AOT LLVM lowering (IncludePathRuntime). Wire VmMetaTags and
VM include resolution to the shared path. Closes #6051.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit c25ef9c into master Jun 8, 2026
@PurHur
PurHur deleted the agent/stdlib-stream-resolve-include-path-6051 branch June 8, 2026 17:10
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: stream_resolve_include_path() — include_path filename resolution missing (ext/standard/streams.c)

1 participant