Skip to content

Fix stream_get_meta_data() php://temp stream_type TEMP (#16577) - #16581

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-16577-stream-meta-temp-type
Jul 5, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-16577-stream-meta-temp-type

Conversation

@PurHur

@PurHur PurHur commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Distinguish php://temp from php://memory in VmStreamMeta::phpNativeStreamType() so stream_get_meta_data()['stream_type'] returns 'TEMP' per php-src (main/streams/php_stream_temp.c).
  • PHP implementation in ext/standard/VmStreamMeta.php — no C runtime changes.

Closes #16577

php-src reference

  • ext/standard/streams.cPHP_FUNCTION(stream_get_meta_data)
  • main/streams/php_stream_temp.c — temp wrapper stream_type label

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php test/repro/maintainer_gap_stream_get_meta_data_temp_type.php'
# ok

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter VmStreamMetaRuntimeShrinkTest test/unit/VmStreamMetaRuntimeShrinkTest.php'
# OK (8 tests, 31 assertions)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter "stream_get_meta_data_temp" test/compliance/'
# OK (3 tests, 3 assertions)

Made with Cursor

Distinguish php://temp from php://memory in VmStreamMeta::phpNativeStreamType
so stream_type matches php-src TEMP label; add repro, compliance, and unit guards.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 98d7117 into master Jul 5, 2026
@PurHur
PurHur deleted the agent/issue-16577-stream-meta-temp-type branch July 5, 2026 18:07
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.

Regression: stream_get_meta_data() php://temp — stream_type MEMORY not TEMP (ext/standard/streams.c)

1 participant