Problem
JIT/AOT already fold literal superglobal access:
$_GET['name'] → compile-time string (SuperglobalInit::compileTimeReadString)
isset($_GET['name']) → constant fold when key is literal
Real apps use dynamic keys:
$key = 'page';
$page = $_GET[$key];
if (isset($_POST[$field])) { ... }
IssetHelper and array-dim lowering must call __hashtable__ runtime lookups when the offset is not a compile-time literal.
Goal
Runtime hashtable get/set/isset for superglobals (and general __hashtable__) with non-constant keys in JIT/AOT.
Tasks
Acceptance criteria
foreach (['a', 'b'] as $k) {
if (isset($_GET[$k])) echo $_GET[$k];
}
Compiles in JIT; correct output when superglobals refreshed per request.
Key files
lib/JIT/IssetHelper.php, lib/JIT/HashTableHelper.php, lib/JIT/SuperglobalInit.php
Related
Problem
JIT/AOT already fold literal superglobal access:
$_GET['name']→ compile-time string (SuperglobalInit::compileTimeReadString)isset($_GET['name'])→ constant fold when key is literalReal apps use dynamic keys:
IssetHelperand array-dim lowering must call__hashtable__runtime lookups when the offset is not a compile-time literal.Goal
Runtime hashtable get/set/isset for superglobals (and general
__hashtable__) with non-constant keys in JIT/AOT.Tasks
HashTableHelperwith dynamic string key load/storeArrayDimFetchinlib/JIT.phpforTYPE_HASHTABLEcontainersIssetHelper::compileHashTableOffsetIsSet— dynamic key path (not onlycompileTimeOffsetIsSet)$_GET[$k]with$kfrom variable; two requests, different outputAcceptance criteria
Compiles in JIT; correct output when superglobals refreshed per request.
Key files
lib/JIT/IssetHelper.php,lib/JIT/HashTableHelper.php,lib/JIT/SuperglobalInit.phpRelated