Skip to content

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

Description

@PurHur

Category

bug · php-src-strict · pillar 4 (correctness)

Problem

$a = @$undef; still emits E_WARNING: Undefined variable $undef on VM/JIT. Zend silences the warning (stderr empty). Bare @$undef; and @$arr['missing'] already match Zend on VM — the gap is specifically error-control applied to an undefined variable used as the RHS of assignment.

Verified 2026-08-08 vs Zend 8.2.32 (bin/vm.php + bin/jit.php).

Repro Zend VM / JIT
$a = @$undef; no warning; ok PHP Warning: Undefined variable $undef + ok
@$undef; (bare) silent silent (OK)
$a = @$b['x']; silent silent (OK)

php-src reference

PHP implementation target

Repro

./script/docker-exec.sh -- bash -lc 'cat > /tmp/at_rhs.php <<'"'"'PHP'"'"'
<?php
error_reporting(E_ALL);
$a = @$undef;
echo \"ok\n\";
PHP
php /tmp/at_rhs.php; echo ---; php bin/vm.php /tmp/at_rhs.php; echo ---; php bin/jit.php /tmp/at_rhs.php'

Done when

  • Repro stderr empty on VM/JIT; stdout ok
  • Bare @$undef; and other already-green @ forms unchanged
  • Compliance .phpt under test/compliance/cases/language/
  • php-src-strict; no php-compiler-strict shortcut

Related

Activity

  1. added
    bugSomething isn't working
    area:vmVirtual machine
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Aug 8, 2026
  2. PurHur commented on Aug 8, 2026

    @PurHur
    OwnerAuthor

    claim: Worker lane C — starting this run

    Pre-triage gates (this host):

    • docker info: ok
    • php script/bootstrap-inventory.php --check: partial — committed docs/bootstrap-inventory.md stale vs tree (method-count drift in ArrayUnique/implode/Compiler; not blocking this language fix)
    • ./script/release-readiness.sh --json: still running in background; will note result if relevant
    • Issue: assign RHS $a = @$undef; still warns on VM/JIT; Zend silent
  3. PurHur commented on Aug 8, 2026

    @PurHur
    OwnerAuthor

    Merged in #29133

    Verification

    • Issue repro: VM/JIT stderr empty, stdout ok (matches Zend)
    • ErrorControlOperatorTest 3/3 (includes stderr-empty assert for assign RHS)
    • JIT at_silence_assign_undef_rhs OK
    • #13587 bare @$undef + error_get_last still OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITarea:vmVirtual machinebugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-2:languagePhase 2 – language features

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions