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
{{ message }}
Repository navigation
Language: static methods on user-defined classes (Expr_StaticCall) #2209
./phpc run -r 'class C{public static function id():string{return "ok";}} echo C::id();'# → ok
./phpc lint examples/003-MiniWebApp # no unsupported Expr_StaticCall on Router (if refactored to use static factory)
Problem
#58 tracks instance methods (
$obj->method()). #2185 ✅ closed::classand minimal static factory patterns for MiniWebApp bootstrap PHPTs.Many compiler and app trees still need user-defined static methods:
Today
Expr_StaticCallon user classes is unsupported or JIT-throws while instance calls are in flight.Goal
VM + AOT (+ JIT follow-up) for public static methods on user classes:
$thisin static methodsnew self()inside static methods when ctor landsImplementation hints
lib/Compiler.phpExpr_StaticCall→ internal func id + class contextlib/VM.phplib/JIT.phplib/AOT/lib/Lint/UnsupportedRegistry.phptest/compliance/cases/class_static_method.phptAcceptance criteria
Harness:
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter class_static_method'Dependencies
Links