Skip to content

A variadic method reached through __call and a dynamic spread receives the whole argument array as one argument. #476

Closed

Description

@blacktrs

Summary

A variadic method reached through __call and a dynamic spread receives the whole argument array as one argument.

Repro

<?php
class Builder { public function many(...$x) { return 'many ' . count($x); } }
class Model {
    public function __call($method, $parameters) { return $this->forward(new Builder, $method, $parameters); }
    protected function forward($object, $method, array $parameters) { return $object->{$method}(...$parameters); }
}
echo (new Model)->many(1, 2, 3), "\n";

Expected (php)

many 3

Actual (manticore de54ecd6, Darwin arm64)

many 1

Tracking

Known-bug repro: tests/aot/repro/wrong/dyn_method_spread_variadic_via_call.php — bash tests/aot/xfail.sh -k dyn_method_spread_variadic_via_call 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 Oct 25, 2026
  2. added a commit that references this issue on Nov 9, 2026
    e89ac72
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