Skip to content

Fix stream_context_create([]) after @mkdir lowering (#16205) - #16221

Closed
PurHur wants to merge 1 commit into
masterfrom
agent/issue-16205-stream-context-empty-after-mkdir
Closed

PurHur wants to merge 1 commit into
masterfrom
agent/issue-16205-stream-context-empty-after-mkdir

Conversation

@PurHur

@PurHur PurHur commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference

  • ext/standard/streams.c — php_stream_context_from_options() accepts empty options array

PHP implementation

  • lib/Compiler.php — errorSuppressEndBlockCallArgHasInlineArrayProducer()

Verification

php bin/vm.php test/repro/maintainer_gap_stream_context_create_after_mkdir.php
# ok

php bin/vm.php test/repro/maintainer_gap_copy_stream_context.php
# copy_stream_context_ok=1

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

php script/bootstrap-inventory.php --check
# OK 4032/4032

Closes #16205

Made with Cursor

Post-@ error-suppress blocks were wiring the suppressed call's return
slot (e.g. mkdir bool) into the next stream_context_create([]) options
arg instead of the hoisted empty-array producer.

Verification: php bin/vm.php test/repro/maintainer_gap_stream_context_create_after_mkdir.php
  php bin/vm.php test/repro/maintainer_gap_copy_stream_context.php
  vendor/bin/phpunit --filter stream_context_create_empty_after_mkdir
Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur

PurHur commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

Duplicate of #16220 (merged) — lane-c landed the same fix first.

@PurHur PurHur closed this Jul 4, 2026
@PurHur
PurHur deleted the agent/issue-16205-stream-context-empty-after-mkdir branch July 9, 2026 18:43
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_context_create([]) after @mkdir — empty literal not typed array (ext/standard/streams.c)

1 participant