Skip to content

A key the child docblock adds to the parent @param array shape is rejected as missing when read through the inherited property #157

Closed

Description

@blacktrs

Summary

A key the child docblock adds to the parent @PARAM array shape is rejected as missing when read through the inherited property.

Repro

<?php
class Box { public function __construct(public int $n) {} }
class Base {
    protected array $options;
    /** @param array{a?: ?bool} $options */
    public function __construct(array $options = []) { $this->options = $options; }
}
class Child extends Base {
    /** @param array{a?: ?bool, b?: int} $options */
    public function __construct(array $options = []) {
        $options['b'] = 7;
        parent::__construct($options);
    }
    public function box(): Box { return new Box($this->options['b']); }
}
echo (new Child(['a' => 1]))->box()->n, "\n";

Expected (php)

7

Actual (manticore 7f55d99b, Darwin arm64)

compile failed (rc=65):
line 15: error: Child__box(): key b is not in array{a?:cell}
compile: front-end (parse/typeck/IR) returned null (rc=65)

Tracking

Known-bug repro: tests/aot/repro/crash/docblock_shape_key_added_by_child_rejected_via_inherited_property.php — bash tests/aot/xfail.sh -k docblock_shape_key_added_by_child_rejected_via_inherited_property reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.

Activity

  1. added
    bug
    crash
    on Oct 9, 2026
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

    bugcrash

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions