Skip to content

Language: Typed property array (private array $config) in VM/JIT/AOT #767

@PurHur

Description

@PurHur

Problem

examples/003-MiniWebApp/src/Router.php declares typed properties:

/** @var array<string, mixed> */
private array $config;

VM serve is green (#539), but native AOT execute currently returns empty stdout (#760) while link succeeds. Typed array properties may lack full lowering in JIT/AOT object layouts compared to untyped properties.

Goal

  • VM/JIT/AOT compile private array $prop on user classes used by the reference app
  • Router constructor assignment $this->config = $config persists through native execute

Implementation hints

Layer Files Notes
Compiler lib/Compiler.php property slots declaredType array
JIT/AOT lib/JIT.php, lib/AOT/ Property offset table; pair with #169 umbrella
Test test/compliance/cases/language/typed_property_array.phpt minimal class
Blocker #760 verify fix unblocks MiniWebApp stdout

Acceptance criteria

./phpc run -r 'class C{private array $a; function __construct(){ $this->a=["k"=>1]; } function g(): int { return $this->a["k"]; }} echo (new C())->g();'
# → 1

./script/ci-local.sh --filter typed_property_array

MiniWebApp AOT home route non-empty HTML after #760 root cause confirmed/fixed.

Dependencies

Verification

./script/ci-fast.sh for VM; @group llvm for AOT probe.

Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions