Skip to content

A named argument after a spread into a variadic function is bound by position instead of by parameter name. #464

Closed

Description

@blacktrs

Summary

A named argument after a spread into a variadic function is bound by position instead of by parameter name.

Repro

<?php
function g(int $a, int $b = 5, bool $boolean = false, ...$rest) { return "$a-$b-" . ($boolean ? 'T' : 'F') . '-' . count($rest); }
$p = [3];
echo g(...$p, boolean: true), "\n";

Expected (php)

3-5-T-0

Actual (manticore aa3f29a9, Darwin arm64)

3-1-F-0

Tracking

Known-bug repro: tests/aot/repro/wrong/variadic_named_args_after_spread.php — bash tests/aot/xfail.sh -k variadic_named_args_after_spread 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