Skip to content

max() called by a run-time name with a string[] spread pack returns the first element, not the largest. #637

Closed

Description

@blacktrs

Summary

max() called by a run-time name with a string[] spread pack returns the first element, not the largest.

Repro

<?php
function callS(string $f, string ...$a): mixed { return $f(...$a); }
$n = 'max';
var_dump(callS($n, 'a', 'b'));

Expected (php)

string(1) "b"

Actual (manticore 4ed3b33f, Darwin arm64)

string(1) "a"

Tracking

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