Problem
lib/Compiler.php::compileStmt() only lowers Jump, JumpIf, and Switch_. Any while, do-while, or for statement hits:
LogicException: Unknown Stmt Type: Stmt\While
Web apps use loops for pagination, template rows, retry logic, and route tables. #115 (break/continue) depends on this.
Goal
Support standard PHP loop forms in VM and JIT:
for ($i = 0; $i < count($items); $i++) { /* ... */ }
while ($row = next($rows)) { /* ... */ }
do { /* ... */ } while ($cond);
Tasks
Acceptance criteria
$s = 0;
for ($i = 0; $i < 5; $i++) { $s += $i; }
echo $s; // 10
Runs identically in bin/vm.php and bin/jit.php.
Dependencies
Files
lib/Compiler.php, lib/OpCode.php, lib/VM.php, lib/JIT.php
test/compliance/cases/language/
Problem
lib/Compiler.php::compileStmt()only lowersJump,JumpIf, andSwitch_. Anywhile,do-while, orforstatement hits:Web apps use loops for pagination, template rows, retry logic, and route tables. #115 (break/continue) depends on this.
Goal
Support standard PHP loop forms in VM and JIT:
Tasks
TYPE_JUMP/TYPE_JUMPIFgraph) for loop entry, condition, increment, and exit blocksPHPCfg\Op\Stmt\While_,For_,DoWhileincompileStmt()lib/VM.php(block linking + scope for loop variables)lib/JIT.php(phi nodes for loop-carried values)break/continueintegration (Language: break and continue for loops and switch #115)docs/capabilities.mdwhen matrix lands (DevEx: Builtin capability matrix (VM / JIT / AOT per function) #176)Acceptance criteria
Runs identically in
bin/vm.phpandbin/jit.php.Dependencies
Files
lib/Compiler.php,lib/OpCode.php,lib/VM.php,lib/JIT.phptest/compliance/cases/language/