Problem
Shipped examples/001-SimpleWeb/example.php does:
On stock PHP 8 with E_ALL, a request without name emits:
Warning: Undefined array key "name"
The compiler may throw, return null, or behave inconsistently across VM / JIT / AOT for missing hashtable keys — especially superglobals populated by lib/Web/Superglobals.php.
MiniWebApp routing (#67, #210) and forms need predictable behavior before ?? (#99) is implemented everywhere.
Goal
Define, document, and test missing-key semantics for $_GET, $_POST, and ordinary arrays so web apps can rely on the same policy as PHP 8.x (or a deliberate subset documented in README).
Scope
Acceptance criteria
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
./phpc run examples/001-SimpleWeb/example.php
Behavior is documented and covered by a PHPT (pass or explicit XFAIL with issue link until fixed).
With ?? implemented (#99), the same script with ?? 'Guest' runs without notices on both Zend and compiler.
Verification (local only)
No GitHub Actions required. Use Docker command above and ./script/ci-local.sh --filter undefined.
Dependencies
Links
Problem
Shipped
examples/001-SimpleWeb/example.phpdoes:On stock PHP 8 with
E_ALL, a request withoutnameemits:The compiler may throw, return
null, or behave inconsistently across VM / JIT / AOT for missing hashtable keys — especially superglobals populated bylib/Web/Superglobals.php.MiniWebApp routing (#67, #210) and forms need predictable behavior before
??(#99) is implemented everywhere.Goal
Define, document, and test missing-key semantics for
$_GET,$_POST, and ordinary arrays so web apps can rely on the same policy as PHP 8.x (or a deliberate subset documented in README).Scope
lib/VM.php/ JIT dim-fetch paths for array/superglobal readstest/real/cases/: missing$_GET['key']with defaulterror_reportingdocs/or next to DevEx: Builtin capability matrix (VM / JIT / AOT per function) #176 capability notes$name = $_GET['name'] ?? 'Guest';(optional follow-up PR)Acceptance criteria
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \ ./phpc run examples/001-SimpleWeb/example.phpBehavior is documented and covered by a PHPT (pass or explicit
XFAILwith issue link until fixed).With
??implemented (#99), the same script with?? 'Guest'runs without notices on both Zend and compiler.Verification (local only)
No GitHub Actions required. Use Docker command above and
./script/ci-local.sh --filter undefined.Dependencies
isset/emptyon superglobalsLinks
examples/001-SimpleWeb/example.php,lib/Web/Superglobals.php