Description
static::X inside a static method should resolve via late static binding, but the current compiler panics during codegen instead of compiling the program or producing a diagnostic.
Minimal reproduction
<?php
class A { const X = 'A'; public static function show() { echo static::X; } }
class B extends A { const X = 'B'; }
B::show();
Steps to reproduce
- Save the program as
main.php.
- Run
php main.php.
- Compile with elephc:
target/debug/elephc main.php.
Expected behavior
PHP 8.4 prints:
Elephc should either match PHP or emit a normal unsupported-feature diagnostic. It should not panic.
Actual behavior
Compilation aborts with a Rust panic:
thread 'main' panicked at src/codegen/expr/objects.rs:480:10:
ScopedConstantAccess on `static` not supported yet
Environment
- elephc 0.23.5
- PHP 8.4.19
- macOS arm64
- reproduced on 2026-06-05
Notes
This is a compiler crash, not just a semantic mismatch.
Description
static::Xinside a static method should resolve via late static binding, but the current compiler panics during codegen instead of compiling the program or producing a diagnostic.Minimal reproduction
Steps to reproduce
main.php.php main.php.target/debug/elephc main.php.Expected behavior
PHP 8.4 prints:
Elephc should either match PHP or emit a normal unsupported-feature diagnostic. It should not panic.
Actual behavior
Compilation aborts with a Rust panic:
Environment
Notes
This is a compiler crash, not just a semantic mismatch.