Skip to content

A dynamic-name call whose candidate set has an inline-only (variadic) method yields an empty result for a name that exists only on a subclass or on the variadic base method #183

Closed

Description

@blacktrs

Summary

A dynamic-name call whose candidate set has an inline-only (variadic) method yields an empty result for a name that exists only on a subclass or on the variadic base method.

Repro

<?php
class Base
{
    public function __call_marker(): string { return 'base'; }
    public function variadic(string ...$parts): string { return implode('+', $parts); }
    public function byRef(array &$a): void { $a[] = 1; }
}

class Child extends Base
{
    public function onlyHere(string $x): string { return "child:$x"; }
    public function other(): static { return $this; }
}

function pick(Base $b, array $names, int $i): string
{
    $m = $names[$i];
    return $b->{$m}('v');
}

$c = new Child();
echo pick($c, ['onlyHere', 'variadic'], 0), "\n";
echo pick($c, ['onlyHere', 'variadic'], 1), "\n";

Expected (php)

child:v
v

Actual (manticore 3acfff3f, Darwin arm64)

child:v

Tracking

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

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

    bugwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions