Problem
Multi-file PHP apps rely on magic constants for portable includes:
require __DIR__ . '/../config.php';
The compiler may not lower __DIR__ / __FILE__ / __LINE__ consistently across VM, JIT, and AOT—especially when combined with include (#54).
Goal
Compile-time or runtime-correct magic constants in all execution modes.
Tasks
Acceptance criteria
examples/003-MiniWebApp can load config.php via require __DIR__ . '/../config.php' from public/index.php in VM and AOT.
Related
Problem
Multi-file PHP apps rely on magic constants for portable includes:
The compiler may not lower
__DIR__/__FILE__/__LINE__consistently across VM, JIT, and AOT—especially when combined withinclude(#54).Goal
Compile-time or runtime-correct magic constants in all execution modes.
Tasks
lib/Compiler.php__FILE__from current script path inRuntime::parseAndCompileFile__DIR__=dirname(__FILE__)during include stack walks__LINE__: map to CFG line info or fixed per-opcode metadata__DIR__-relative path resolves correctlyAcceptance criteria
examples/003-MiniWebAppcan loadconfig.phpviarequire __DIR__ . '/../config.php'frompublic/index.phpin VM and AOT.Related