You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#55 tracks emitting non-void values in JIT; this issue adds reading and enforcing: return types from php-cfg in the compiler (VM checks, JIT typed returns, AOT metadata).
examples/003-MiniWebApp/src/Router.php already uses : void on dispatch() and private render* methods — they will fail type checks once #145 methods compile unless returns are wired here.
Problem
Modern PHP web code uses declared return types on functions and methods:
#55 tracks emitting non-void values in JIT; this issue adds reading and enforcing
:return types from php-cfg in the compiler (VM checks, JIT typed returns, AOT metadata).examples/003-MiniWebApp/src/Router.phpalready uses: voidondispatch()and privaterender*methods — they will fail type checks once #145 methods compile unless returns are wired here.Goal
TYPE_RETURNagainst declared type (respect Language: declare(strict_types=1) enforcement in VM #156strict_typeswhen enabled)(): void— reject non-null returnsImplementation hints
lib/Compiler.phpcompileFunction,compileClassBodyFunc::returnType/ method return type fromPHPCfglib/VM.phpTYPE_RETURNTypeErroron mismatch whenstrict_types=1lib/JIT.phpreturn loweringlib/Lint/UnsupportedRegistry.phptest/compliance/cases/return_type_*.phptMiniWebApp
After #145 lands,
Router::dispatch(): voidmust not require stripping return types from the reference app.Acceptance criteria
Throws
TypeErrorin VM (message parity optional v1).Prints
ok.Verification (local / Docker only)
Dependencies
strict_typesenforcement: voidRelated
examples/003-MiniWebApp/src/Router.php