Skip to content

A named argument after a spread into a closure value is bound by position instead of by parameter name. #463

Closed

Description

@blacktrs

Summary

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

Repro

<?php
$c = fn(int $a, int $b = 2, $z = 'zz') => "$a $b $z";
echo $c(...[1], z: 'Q'), "\n";

Expected (php)

1 2 Q

Actual (manticore aa3f29a9, Darwin arm64)


[exit code 255]
PHP Fatal error:  Uncaught TypeError: Argument must be of type int, string given

Tracking

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