Skip to content

Fix @ suppress slot stealing hoisted null call args (#13248) - #16150

Merged
PurHur merged 1 commit into
masterfrom
agent/stdlib-error-suppress-hoisted-call-arg
Jul 4, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/stdlib-error-suppress-hoisted-call-arg

Conversation

@PurHur

@PurHur PurHur commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference

  • ext/standard/streams.c — stream_context_create() accepts null/empty array
  • ext/standard/file.c — copy() optional $context third argument

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/repro/maintainer_gap_copy_stream_context.php
php bin/vm.php test/compliance/cases/stdlib/copy_stream_context.phpt
php bin/compile.php -l test/repro/maintainer_gap_copy_stream_context.php
vendor/bin/phpunit --filter "copy_stream_context|get_cfg_var_display_errors|ErrorSuppressInlineReturnSlotTest"
'

Output (2026-07-04):

copy_stream_context_ok=1
bool(true)
.... OK (10 tests, 20 assertions)

Relates to closed #13248 (copy $context arg) and #15916 (@ suppress forwarding).

Made with Cursor

Post-ErrorSuppressBlock lowering was wiring the first dead inline temp
on any following call to the silenced expression return slot, so patterns
like `@mkdir($dir); copy(..., stream_context_create([]))` passed mkdir's
bool into stream_context_create(). Only bind when the outer call actually
consumes the suppressed inner result (#10336, #15916).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 5a1ca6f into master Jul 4, 2026
@PurHur
PurHur deleted the agent/stdlib-error-suppress-hoisted-call-arg branch July 4, 2026 18:44
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: copy() optional stream context third argument rejected — LogicException (ext/standard/file.c)

1 participant