Skip to content

A first-class callable or array callable naming a static method through an object variable passes the wrong arguments. #573

Closed

Description

@blacktrs

Summary

A first-class callable or array callable naming a static method through an object variable passes the wrong arguments.

Repro

<?php
class R { public static function fl(string $l, int $n = 1): string { return implode('_', [$l, 'x']) . $n; } }
$o = new R;
$c = $o->fl(...); echo $c('f'), "\n";
$f = [$o, 'fl']; echo $f('d'), "\n";
echo call_user_func([$o, 'fl'], 'e', 3), "\n";

Expected (php)

f_x1
d_x1
e_x3

Actual (manticore bce35f17, 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/static_method_fcc_on_local_object.php — bash tests/aot/xfail.sh -k static_method_fcc_on_local_object 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 6, 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