Skip to content

A user function called by a run-time name with more arguments than it declares throws "Call to undefined function" instead of ignoring the extra ones. #641

Closed

Description

@blacktrs

Summary

A user function called by a run-time name with more arguments than it declares throws "Call to undefined function" instead of ignoring the extra ones.

Repro

<?php
function addOne(int &$v, int $k): void { $v += 1; }
$v = 1;
$f = $argc > 9 ? '' : 'addOne';
$f($v, 2, 3);
echo $v, "\n";
$a = [1, 2];
array_walk($a, $f);
echo implode(',', $a), "\n";

Expected (php)

2
2,3

Actual (manticore 5645e4d7, Darwin arm64)


[exit code 255]
PHP Fatal error:  Uncaught Error: Call to undefined function addOne()

Tracking

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