Skip to content

Language: silence value-consuming @ CV fetch (#31881) - #31897

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-31881-at-silence-value-fetch
Aug 17, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-31881-at-silence-value-fetch

Conversation

@PurHur

@PurHur PurHur commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • php-cfg represented @$cv as a dummy UnaryPlus fetch under silence but still returned the original CV, so echo / arithmetic / call-arg re-fetched after END_SILENCE and emitted Undefined variable.
  • Materialize @$cv into an Assign temp under silence and forward that temp (null, not +null → 0). isErrorSuppressInnerExpr() now also treats unary/binary inner exprs so the suppress result slot is inherited.
  • php-src: Zend/zend_compile.c ZEND_BEGIN_SILENCE / ZEND_END_SILENCE; Zend/zend_execute.c undefined-variable E_WARNING on CV fetch. PHP implementation: patches/php-cfg-error-suppress-cv-temp.patch + lib/Compiler.php. No new runtime/*.c.

Closes #31881

Test plan

  • Issue repro VM vs Zend
  • Issue repro JIT
  • ./script/phpunit.sh --filter ErrorControlOperatorTest

Verification

./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_at_silence_undef.php; echo "---ZEND---"; php bin/vm.php test/repro/maintainer_gap_at_silence_undef.php'

Zend and VM both: assign NULL, echo NULL, plus 1, callarg 0 + strlen(null) Deprecated, bare/print silent. No Undefined variable.

./script/docker-exec.sh -- bash -lc 'php bin/jit.php test/repro/maintainer_gap_at_silence_undef.php'

JIT: same stdout; stderr has only the strlen(null) Deprecated (plus an unrelated php-cfg implicit-nullable Deprecated). No Undefined variable.

./script/phpunit.sh --filter ErrorControlOperatorTest

OK (5 tests, 9 assertions) including at_silence_value_undef.phpt.

Not run: script/differential-sweep.sh, full ci-local.sh, north-star5-verify --strict.

Made with Cursor

php-cfg forwarded the original CV after END_SILENCE, so echo/arithmetic/call-arg
re-fetched it and warned. Materialize @$cv into an Assign temp under silence so
consumers get null without a second fetch (Zend ZEND_BEGIN_SILENCE).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit d7134a6 into master Aug 17, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-31881-at-silence-value-fetch branch August 17, 2026 06:28
PurHur added a commit that referenced this pull request Aug 17, 2026
…tch (#31893)

Co-authored-by: Cursor <cursoragent@cursor.com>

#31897 added patches/php-cfg-error-suppress-cv-temp.patch, which changes the helper-runtime core fingerprint. Helper sources/deps were unchanged, so --refresh-global-fingerprints updates unit+arch keys without restamping .o bytes.
PurHur added a commit that referenced this pull request Aug 17, 2026
* Trust: refresh 26 stale helper-runtime prelink units (#31893)

Re-emit Nullsafe/DOM/AssertOptions/Ini helper objects from current sources so check-helper-runtime-prelink --strict is 410 fresh / 0 stale.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Trust: rewrite helper-runtime fingerprints after php-cfg @-silence patch (#31893)

Co-authored-by: Cursor <cursoragent@cursor.com>

#31897 added patches/php-cfg-error-suppress-cv-temp.patch, which changes the helper-runtime core fingerprint. Helper sources/deps were unchanged, so --refresh-global-fingerprints updates unit+arch keys without restamping .o bytes.

---------

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: echo/@$undef / arithmetic / call-arg still warn — Zend silences (re-#29132, zend_compile.c)

1 participant