Problem
No Foreach handling in lib/Compiler.php (grep shows no TYPE_FOREACH). Web apps iterate query params, DB rows, and template data constantly.
Goal
foreach ($arr as $k => $v) on packed and string-key hashtables.
Tasks
Acceptance criteria
foreach (['a' => 1, 'b' => 2] as $k => $v) { echo $k, $v; }
runs in VM and JIT.
Note
Associative arrays with string keys may depend on hashtable string-key maturity (separate issue).
Problem
No
Foreachhandling inlib/Compiler.php(grep shows noTYPE_FOREACH). Web apps iterate query params, DB rows, and template data constantly.Goal
foreach ($arr as $k => $v)on packed and string-key hashtables.Tasks
PHPCfg\Op\Stmt\Foreach_to opcodes (iterator state or indexed loop for packed arrays)lib/VM.phplib/JIT.php(may reuseHashTableiterate helpers)$_GETkey iteration (after dynamic superglobals)Acceptance criteria
runs in VM and JIT.
Note
Associative arrays with string keys may depend on hashtable string-key maturity (separate issue).