## Category `language` ## Problem When a class `implements` an interface but omits a required method, Zend fails at **compile time**: ```text Fatal error: Class C contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (I::f) ``` This compiler **accepts** the class and runs it — verified May 2026: ```php interface I { public function f(): int; } class C implements I {} echo "ok\n"; // prints ok on bin/vm.php ``` ## php-src reference - [php/php-src `Zend/zend_inheritance.c`](https://github.com/php/php-src/blob/master/Zend/zend_inheritance.c) — `zend_do_implement_interface`, abstract method count - [php/php-src `Zend/zend_compile.c`](https://github.com/php/php-src/blob/master/Zend/zend_compile.c) — `zend_verify_abstract_class` ## Repro (failure today) ```php <?php interface I { public function f(): int; } class C implements I {} echo "ok\n"; ``` ```bash ./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php repro.php; echo vm:$?' # prints ok, vm:0 (wrong) php repro.php; echo zend:$? # zend:255 — Fatal error: Class C contains 1 abstract method… ``` ### Variant: wrong signature ```php interface I { public function f(): int; } class C implements I { public function f(): string { return 'x'; } } ``` Zend: return type compatibility error at compile time (coordinate with **#3323** variance). ## Scope | Module | Path | |--------|------| | Compiler | `lib/Compiler.php` — after `compileClassLike`, verify interface method set | | VM | optional runtime guard on `TYPE_DECLARE_CLASS` for eval/includes | | Inheritance | reuse method tables from **#101** / **#144** | | Tests | `test/compliance/cases/language/interface_missing_method.phpt` | ## Done when - [ ] Missing method repro → compile-time fatal (message matches Zend subset) - [ ] Class with all methods implemented → compiles and runs - [ ] Multiple interfaces — report first missing method or aggregate count like Zend - [ ] `./script/ci-fast.sh --filter interface_missing` green ## Links - **#144** umbrella — claim **this issue** for the compile-time check only - **#101** extends / `instanceof` interface - **#1492**
Activity
PurHur commentedon May 29, 2026
claim: cursor-agent-lane-c — starting this run
Language: compile-time fatal for incomplete interface implementation (#…
Language: guard implements clause with issue #3536 compliance tests (#…