Skip to content

Runtime: undefined array/superglobal key — Zend notice parity (#273) - #364

Merged
PurHur merged 1 commit into
masterfrom
issue-273-undefined-array-key
May 20, 2026
Merged

Runtime: undefined array/superglobal key — Zend notice parity (#273)#364
PurHur merged 1 commit into
masterfrom
issue-273-undefined-array-key

Conversation

@PurHur

@PurHur PurHur commented May 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • VM: emit Warning: Undefined array key "…" on missing string/integer keys while reads still return null (PHP 8 parity).
  • JIT/AOT: same warning from __hashtable__readStringKeyValue via __compiler_undefined_array_key_warning_cstr.
  • Document policy in docs/runtime-semantics.md; add PHPT undefined_array_key_get and UndefinedArrayKeyTest.

Test plan

  • php vendor/bin/phpunit --exclude-group llvm,serve (378 tests) in php-compiler:22.04-dev
  • test/real/RealWorldTest includes new PHPT
  • Manual: php bin/compile.php -o /tmp/t -r '$x=$_GET["n"];' → stderr warning on run

Closes #273

Made with Cursor

Emit Zend-style warnings on missing string keys in VM and JIT/AOT
hashtable reads while still yielding null; document semantics and add
PHPT plus unit coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 6545945 into master May 20, 2026
@PurHur
PurHur deleted the issue-273-undefined-array-key branch May 20, 2026 15:11
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.

Runtime: Undefined array/superglobal key — Zend notice parity

1 participant