Skip to content

A variadic method reached through an erased receiver gets its trailing arguments unpacked when another class declares the name non-variadically. #583

Closed

Description

@blacktrs

Summary

A variadic method reached through an erased receiver gets its trailing arguments unpacked when another class declares the name non-variadically.

Repro

<?php
class QB { public array $s = []; public function select(mixed ...$sel): static { $this->s[] = json_encode($sel); return $this; } }
class RD { public function select($db) { return 1; } }
function er(mixed $q) { return $q->select('e1', 'e2'); }
echo json_encode(er(new QB)->s), "\n";

Expected (php)

["[\"e1\",\"e2\"]"]

Actual (manticore 1a4301e0, Darwin arm64)

["[]"]

Tracking

Known-bug repro: tests/aot/repro/wrong/erased_receiver_variadic_method.php — bash tests/aot/xfail.sh -k erased_receiver_variadic_method 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
    wrong-answer
    on Nov 7, 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

    bugwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions