Skip to content

Language: silence @ on assignment RHS (#29132) - #29133

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-29132-at-assign-rhs-silence
Aug 8, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-29132-at-assign-rhs-silence

Conversation

@PurHur

@PurHur PurHur commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Closes Language: @$undef as assignment RHS still warns — Zend silences (ZEND_BEGIN_SILENCE) #29132: $a = @$undef; no longer emits Undefined variable on VM/JIT (Zend-silent).
  • Root cause: php-cfg #13587 used UnaryPlus inside @ to force a CV check, but returned the original CV; post-END_SILENCE assign re-fetched it. UnaryPlus also coerces null→0, so it cannot be the @ expression value.
  • Fix: materialize bare @$cv with Assign into a temp under silence (preserves null); return that result. Compiler treats Assign as an error-suppress primary for slot inheritance.

php-src: Zend/zend_compile.c / zend_execute.c (ZEND_BEGIN_SILENCE).

Test plan

  • Issue repro (stderr empty, stdout ok) — VM + JIT
  • vendor/bin/phpunit test/unit/ErrorControlOperatorTest.php — 3/3
  • vendor/bin/phpunit --filter at_silence_assign_undef_rhs test/compliance/ErrorSuppressJITTest.php — OK
  • #13587 error_get_last_at_read_stmt.phpt still OK on VM
  • @$b = 1 / $x = @$c = 2 unchanged vs Zend

Verification transcript

$ php bin/vm.php /tmp/at_rhs.php 2>&1   # $a=@$undef; echo ok
ok
$ php bin/jit.php /tmp/at_rhs.php 2>&1 | grep -v Deprecated
ok
$ vendor/bin/phpunit test/unit/ErrorControlOperatorTest.php
OK (3 tests, 5 assertions)

Pre-triage: user_release_ready: yes (north-star5-fast ok); inventory doc drift pre-existing on master (unrelated).

Made with Cursor

Materialize bare `@$cv` under ErrorSuppress via Assign into a temp so
post-silence consumers do not re-fetch the CV (UnaryPlus coerced null→0).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 6e87f4e into master Aug 8, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-29132-at-assign-rhs-silence branch August 8, 2026 18:44
PurHur added a commit that referenced this pull request Aug 8, 2026
patches/php-cfg-bare-variable-read-stmt.patch changed coreFingerprint
material, so the committed corpus was skipped wholesale and cold hello-world
timed out. Honest --prelink republish: 370 fresh / 0 stale (Closes #29149).

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Language: @$undef as assignment RHS still warns — Zend silences (ZEND_BEGIN_SILENCE)

1 participant