Problem
Classes can be declared (properties only in class body—see lib/Compiler.php compileClassBody). VM supports new, property fetch; JIT throws Other class body types are not jittable for now for methods.
Goal
Simple OOP for web apps: controller classes with methods, $this->prop.
Tasks
Acceptance criteria
class Page { public function render(): string { return '<p>ok</p>'; } }
echo (new Page())->render();
in JIT mode.
Files
lib/VM.php, lib/JIT.php, lib/JIT/Builtin/Type/Object_.php
Problem
Classes can be declared (properties only in class body—see
lib/Compiler.phpcompileClassBody). VM supportsnew, property fetch; JIT throwsOther class body types are not jittable for nowfor methods.Goal
Simple OOP for web apps: controller classes with methods,
$this->prop.Tasks
TYPE_METHOD_CALL, constructor,$thishandlinglib/JIT/Builtin/Type/Object_.phpassert(null === $class->extends))public functionvisibility onlyAcceptance criteria
in JIT mode.
Files
lib/VM.php,lib/JIT.php,lib/JIT/Builtin/Type/Object_.php