Skip to content

Epic: Language wave 4 — callables + inheritance + generators (web-capable subset) #2483

@PurHur

Description

@PurHur

Category

language (epic / coordination)

Problem

Many individual language issues exist (#72, #142, #101, #144, #167) but contributors lack a single ordered map with Zend references, repros, and done-when criteria for the “normal small PHP app” subset (callables + inheritance + generators).

North star subset (Zend / php-src)

Area Zend reference This repo Tracking
Closures + use Zend/zend_closures.c VM yes; use (&$x) JIT #3097; AOT stub #72, #3097
Arrow fn desugar to closure VM/JIT yes; AOT no #142
extends + override zend_inheritance.c VM yes (extends_method_override.phpt); JIT/AOT gaps #101 (refresh)
Traits / interfaces zend_traits.c VM simple use Trait; adaptations #144 #144, #2312
Generators zend_generators.c VM yes; JIT #3074; AOT #3115 #167, #3074, #3115

Worker repro pack (VM-first)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && ./script/ci-fast.sh --filter "Closure|Arrow|extends|Trait|Generator"'
php script/capability-syntax.php   # refresh docs/capabilities-syntax.md

Per-child minimum spec

Each child issue must include: php-src path, repro .php, done-when command, and claim: comment before PR.

Recommended order (dependencies)

  1. Compiler: Class inheritance (extends) and interfaces #101 — confirm VM extends + document JIT/AOT/parent:: gaps (Language: parent::class and parent::$property (deferred from #1858) #3093)
  2. Language: Traits, abstract classes, and interfaces #144 — trait insteadof / alias (after simple trait use green)
  3. Language: Closures and anonymous functions #72 / Language: Closure use-by-reference JIT lowering (#72 phase 2) #3097 — closure use by-ref for JIT/AOT
  4. Language: Arrow functions (fn() => expr) #142 — arrow AOT (desugar)
  5. Language: Generators (yield and yield from) #167 / Language: Generator JIT lowering (yield opcodes) #3074 / Language: Generator AOT lowering (yield / suspend resume) #3115 — generator VM → JIT → AOT

Done when (epic)

  • All rows above have implementation-ready child issues with green VM repros
  • docs/unsupported-syntax.md lists only true lint gaps
  • docs/capabilities-syntax.md regenerated and honest for JIT/AOT columns

Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions