Skip to content

Stdlib: stream_get_meta_data()/stream_set_blocking() — VM+JIT+AOT (#6007) - #7893

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-6007-stream-meta-blocking
Jun 10, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-6007-stream-meta-blocking

Conversation

@PurHur

@PurHur PurHur commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • Register stream_get_meta_data() and stream_set_blocking() in ext/standard/Module.php with php-src reference ext/standard/streams.c.
  • VM: VmFs::streamGetMetaData() / streamSetBlocking() delegate to host PHP on stream handles; convert meta arrays to HashTable.
  • JIT/AOT: StreamMetaJit LLVM helpers (__compiler_stream_get_meta_data, __compiler_stream_set_blocking) + lowering in JitStreamGetMetaData / JitStreamSetBlocking.
  • No new C runtime logic — PHP-in-PHP path only.

Closes #6007

php-src reference

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/repro/stream_meta_blocking_missing.php
vendor/bin/phpunit --filter "stream_get_meta_data|stream_set_blocking"
vendor/bin/phpunit --filter stream_meta_blocking
php bin/compile.php -l test/fixtures/aot/compile-only/stream_meta_blocking.php
'

Observed (2026-06-10):

bool(true)   # function_exists stream_get_meta_data
bool(true)   # function_exists stream_set_blocking
bool(true)   # is_array(meta)
bool(true)   # keys present
bool(true)   # stream_set_blocking true
OK (4 tests, 4 assertions)   # VM + JIT compliance
OK (1 test, 2 assertions)     # compile-only catalog
exit:0                        # AOT lint (-l)

Test plan

  • VM repro test/repro/stream_meta_blocking_missing.php
  • Compliance stream_get_meta_data.phpt / stream_set_blocking.phpt (VM + JIT)
  • AOT compile-only fixture test/fixtures/aot/compile-only/stream_meta_blocking.php
  • php bin/compile.php -l on compile-only fixture

Made with Cursor

Register missing stream introspection builtins with php-src parity via
VmFs host delegation on VM and StreamMetaJit LLVM helpers for JIT/AOT lint.

Closes #6007

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 7c5cb3d into master Jun 10, 2026
@PurHur
PurHur deleted the agent/issue-6007-stream-meta-blocking branch June 10, 2026 17:29
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_get_meta_data()/stream_set_blocking() — missing stream introspection APIs (ext/standard/streams.c)

1 participant