Skip to content

A function called by a run-time name with a string-keyed spread pack binds the values by position, not by parameter name. #640

Closed

Description

@blacktrs

Summary

A function called by a run-time name with a string-keyed spread pack binds the values by position, not by parameter name.

Repro

<?php
function named(int $x, int $y): string { return "x=$x y=$y"; }
/** @param array<string, mixed> $a */
function callA(string $f, array $a): mixed { return $f(...$a); }
var_dump(callA('named', ['y' => 3, 'x' => 1]));

Expected (php)

string(7) "x=1 y=3"

Actual (manticore 4ed3b33f, Darwin arm64)

string(7) "x=3 y=1"

Tracking

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