Skip to content

Language: unimplemented abstract method Fatal cites child Class::m — Zend parent (zend_compile.c / zend_inheritance.c) #30022

Description

@PurHur

Category

Language · php-src-strict · abstract inheritance fatal text

Problem

When a concrete class extends an abstract class without implementing an abstract method, Zend’s compile Fatal lists the declaring parent method (A::f). VM lists the child (B::f).

Interface incompleteness already matches (I::f on both sides). Distinct from closed trait/interface abstract-text tickets (#25912, #3386).

Probed 2026-08-10 — php:8.4-cli 8.4.24 vs PHP_COMPILER_PROFILE=8.4 php bin/vm.php @ ffdc565828.

Repro Zend 8.4.24 VM (PROFILE=8.4)
abstract class A { abstract function f(); } eval('class B extends A {}'); … remaining methods (A::f) … remaining methods (B::f)
interface I { function f(); } eval('class B implements I {}'); (I::f) (I::f) (match)

php-src reference

PHP implementation target

  • Compile / class-inheritance check in lib/ — when emitting the “contains N abstract method(s)” Fatal for extends, cite the origin class::method (abstract parent), not the concrete child
  • PHP-in-PHP; no new runtime/*.c logic

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
export PHP_COMPILER_PROFILE=8.4
printf "%s\n" "<?php
abstract class A { abstract function f(); }
eval(\"class B extends A {}\");
" >/tmp/abs_cite.php
php bin/vm.php /tmp/abs_cite.php
'
# Zend: docker run --rm -i php:8.4-cli php </tmp/abs_cite.php

Done when

  • Fatal for unimplemented abstract parent method cites Parent::method matching Zend
  • Interface residual list still cites the interface (I::f)
  • Compliance .phpt under test/compliance/cases/
  • php-src-strict; no php-compiler-strict shortcut

Activity

  1. added
    bugSomething isn't working
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Aug 10, 2026
  2. PurHur commented on Aug 10, 2026

    @PurHur
    OwnerAuthor

    claim: Worker lane B — starting this run

    Pillar 1 probe (pre-claim):

  3. PurHur commented on Aug 10, 2026

    @PurHur
    OwnerAuthor

    claim: Worker lane B — starting this run

    Pillar 1 probe:

    Target: unimplemented abstract Fatal cites child Class::m; Zend cites declaring parent (A::f).

  4. PurHur commented on Aug 10, 2026

    @PurHur
    OwnerAuthor

    Backing off — earlier Lane B claim at 22:14:54Z owns this (ClassValidator WIP already in tree). Switching to #30028.

  5. PurHur commented on Aug 10, 2026

    @PurHur
    OwnerAuthor

    Merged #30040

    Verification:

    • Repro (PHP_COMPILER_PROFILE=8.4 php bin/vm.php eval incomplete child): (A::f) (was (B::f))
    • Interface residual still (I::f); trait still (C::f); grandparent via mid still (A::f)
    • ./script/phpunit.sh --filter AbstractParentMethodCite → OK (6 tests, 11 assertions)

    Pillar 1 pre-claim: user_release_ready=yes, north-star5-fast ok (gen-0 provenance stale noted only).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITbugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-2:languagePhase 2 – language features

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions